| 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 13 matching lines...) Expand all Loading... |
| 24 using ui::PageTransition; | 24 using ui::PageTransition; |
| 25 using content::RenderViewHost; | 25 using content::RenderViewHost; |
| 26 using content::WebContents; | 26 using content::WebContents; |
| 27 | 27 |
| 28 namespace navigation_interception { | 28 namespace navigation_interception { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 const int kMaxValidityOfUserGestureCarryoverInSeconds = 10; | 32 const int kMaxValidityOfUserGestureCarryoverInSeconds = 10; |
| 33 | 33 |
| 34 const void* kInterceptNavigationDelegateUserDataKey = | 34 const void* const kInterceptNavigationDelegateUserDataKey = |
| 35 &kInterceptNavigationDelegateUserDataKey; | 35 &kInterceptNavigationDelegateUserDataKey; |
| 36 | 36 |
| 37 bool CheckIfShouldIgnoreNavigationOnUIThread(WebContents* source, | 37 bool CheckIfShouldIgnoreNavigationOnUIThread(WebContents* source, |
| 38 const NavigationParams& params) { | 38 const NavigationParams& params) { |
| 39 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 39 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 40 DCHECK(source); | 40 DCHECK(source); |
| 41 | 41 |
| 42 InterceptNavigationDelegate* intercept_navigation_delegate = | 42 InterceptNavigationDelegate* intercept_navigation_delegate = |
| 43 InterceptNavigationDelegate::Get(source); | 43 InterceptNavigationDelegate::Get(source); |
| 44 if (!intercept_navigation_delegate) | 44 if (!intercept_navigation_delegate) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now(); | 144 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Register native methods. | 147 // Register native methods. |
| 148 | 148 |
| 149 bool RegisterInterceptNavigationDelegate(JNIEnv* env) { | 149 bool RegisterInterceptNavigationDelegate(JNIEnv* env) { |
| 150 return RegisterNativesImpl(env); | 150 return RegisterNativesImpl(env); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace navigation_interception | 153 } // namespace navigation_interception |
| OLD | NEW |