OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.compositor.bottombar; | 5 package org.chromium.chrome.browser.compositor.bottombar; |
6 | 6 |
7 import android.text.TextUtils; | 7 import android.text.TextUtils; |
8 | 8 |
9 import org.chromium.base.VisibleForTesting; | 9 import org.chromium.base.VisibleForTesting; |
10 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Used to intercept intent navigations. | 114 // Used to intercept intent navigations. |
115 // TODO(jeremycho): Consider creating a Tab with the Panel's ContentViewCore
, | 115 // TODO(jeremycho): Consider creating a Tab with the Panel's ContentViewCore
, |
116 // which would also handle functionality like long-press-to-paste. | 116 // which would also handle functionality like long-press-to-paste. |
117 private class InterceptNavigationDelegateImpl implements InterceptNavigation
Delegate { | 117 private class InterceptNavigationDelegateImpl implements InterceptNavigation
Delegate { |
118 final ExternalNavigationHandler mExternalNavHandler; | 118 final ExternalNavigationHandler mExternalNavHandler; |
119 | 119 |
120 public InterceptNavigationDelegateImpl() { | 120 public InterceptNavigationDelegateImpl() { |
121 Tab tab = mActivity.getActivityTab(); | 121 Tab tab = mActivity.getActivityTab(); |
122 mExternalNavHandler = (tab != null && tab.getContentViewCore() != nu
ll) | 122 mExternalNavHandler = (tab != null && tab.getContentViewCore() != nu
ll) |
123 ? new ExternalNavigationHandler(tab) : null; | 123 ? ExternalNavigationHandler.createDefault(tab) : null; |
124 } | 124 } |
125 | 125 |
126 @Override | 126 @Override |
127 public boolean shouldIgnoreNavigation(NavigationParams navigationParams)
{ | 127 public boolean shouldIgnoreNavigation(NavigationParams navigationParams)
{ |
128 // If either of the required params for the delegate are null, do no
t call the | 128 // If either of the required params for the delegate are null, do no
t call the |
129 // delegate and ignore the navigation. | 129 // delegate and ignore the navigation. |
130 if (mExternalNavHandler == null || navigationParams == null) return
true; | 130 if (mExternalNavHandler == null || navigationParams == null) return
true; |
131 // TODO(mdjones): Rather than passing the two navigation params, ins
tead consider | 131 // TODO(mdjones): Rather than passing the two navigation params, ins
tead consider |
132 // passing a boolean to make this API simpler. | 132 // passing a boolean to make this API simpler. |
133 return !mContentDelegate.shouldInterceptNavigation(mExternalNavHandl
er, | 133 return !mContentDelegate.shouldInterceptNavigation(mExternalNavHandl
er, |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 private native long nativeInit(); | 480 private native long nativeInit(); |
481 private native void nativeDestroy(long nativeOverlayPanelContent); | 481 private native void nativeDestroy(long nativeOverlayPanelContent); |
482 private native void nativeRemoveLastHistoryEntry( | 482 private native void nativeRemoveLastHistoryEntry( |
483 long nativeOverlayPanelContent, String historyUrl, long urlTimeMs); | 483 long nativeOverlayPanelContent, String historyUrl, long urlTimeMs); |
484 private native void nativeSetWebContents(long nativeOverlayPanelContent, | 484 private native void nativeSetWebContents(long nativeOverlayPanelContent, |
485 ContentViewCore contentViewCore, WebContentsDelegateAndroid delegate
); | 485 ContentViewCore contentViewCore, WebContentsDelegateAndroid delegate
); |
486 private native void nativeDestroyWebContents(long nativeOverlayPanelContent)
; | 486 private native void nativeDestroyWebContents(long nativeOverlayPanelContent)
; |
487 private native void nativeSetInterceptNavigationDelegate(long nativeOverlayP
anelContent, | 487 private native void nativeSetInterceptNavigationDelegate(long nativeOverlayP
anelContent, |
488 InterceptNavigationDelegate delegate, WebContents webContents); | 488 InterceptNavigationDelegate delegate, WebContents webContents); |
489 } | 489 } |
OLD | NEW |