OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "components/navigation_interception/intercept_navigation_delegate.h" | 5 #include "components/navigation_interception/intercept_navigation_delegate.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" | 10 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace navigation_interception { | 26 namespace navigation_interception { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 const void* kInterceptNavigationDelegateUserDataKey = | 30 const void* kInterceptNavigationDelegateUserDataKey = |
31 &kInterceptNavigationDelegateUserDataKey; | 31 &kInterceptNavigationDelegateUserDataKey; |
32 | 32 |
33 bool CheckIfShouldIgnoreNavigationOnUIThread(WebContents* source, | 33 bool CheckIfShouldIgnoreNavigationOnUIThread(WebContents* source, |
34 const NavigationParams& params) { | 34 const NavigationParams& params) { |
35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 35 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
36 DCHECK(source); | 36 DCHECK(source); |
37 | 37 |
38 InterceptNavigationDelegate* intercept_navigation_delegate = | 38 InterceptNavigationDelegate* intercept_navigation_delegate = |
39 InterceptNavigationDelegate::Get(source); | 39 InterceptNavigationDelegate::Get(source); |
40 if (!intercept_navigation_delegate) | 40 if (!intercept_navigation_delegate) |
41 return false; | 41 return false; |
42 | 42 |
43 return intercept_navigation_delegate->ShouldIgnoreNavigation(params); | 43 return intercept_navigation_delegate->ShouldIgnoreNavigation(params); |
44 } | 44 } |
45 | 45 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 jobject_params.obj()); | 95 jobject_params.obj()); |
96 } | 96 } |
97 | 97 |
98 // Register native methods. | 98 // Register native methods. |
99 | 99 |
100 bool RegisterInterceptNavigationDelegate(JNIEnv* env) { | 100 bool RegisterInterceptNavigationDelegate(JNIEnv* env) { |
101 return RegisterNativesImpl(env); | 101 return RegisterNativesImpl(env); |
102 } | 102 } |
103 | 103 |
104 } // namespace navigation_interception | 104 } // namespace navigation_interception |
OLD | NEW |