| 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_throttle.h" | 10 #include "components/navigation_interception/intercept_navigation_throttle.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return static_cast<InterceptNavigationDelegate*>( | 82 return static_cast<InterceptNavigationDelegate*>( |
| 83 web_contents->GetUserData(kInterceptNavigationDelegateUserDataKey)); | 83 web_contents->GetUserData(kInterceptNavigationDelegateUserDataKey)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 // static | 86 // static |
| 87 scoped_ptr<content::NavigationThrottle> | 87 scoped_ptr<content::NavigationThrottle> |
| 88 InterceptNavigationDelegate::CreateThrottleFor( | 88 InterceptNavigationDelegate::CreateThrottleFor( |
| 89 content::NavigationHandle* handle) { | 89 content::NavigationHandle* handle) { |
| 90 return scoped_ptr<content::NavigationThrottle>( | 90 return scoped_ptr<content::NavigationThrottle>( |
| 91 new InterceptNavigationThrottle( | 91 new InterceptNavigationThrottle( |
| 92 handle, base::Bind(&CheckIfShouldIgnoreNavigationOnUIThread))); | 92 handle, base::Bind(&CheckIfShouldIgnoreNavigationOnUIThread), false)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 // static | 95 // static |
| 96 void InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo( | 96 void InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo( |
| 97 net::URLRequest* request) { | 97 net::URLRequest* request) { |
| 98 const content::ResourceRequestInfo* info = | 98 const content::ResourceRequestInfo* info = |
| 99 content::ResourceRequestInfo::ForRequest(request); | 99 content::ResourceRequestInfo::ForRequest(request); |
| 100 if (!info || !info->HasUserGesture()) | 100 if (!info || !info->HasUserGesture()) |
| 101 return; | 101 return; |
| 102 | 102 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now(); | 147 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Register native methods. | 150 // Register native methods. |
| 151 | 151 |
| 152 bool RegisterInterceptNavigationDelegate(JNIEnv* env) { | 152 bool RegisterInterceptNavigationDelegate(JNIEnv* env) { |
| 153 return RegisterNativesImpl(env); | 153 return RegisterNativesImpl(env); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace navigation_interception | 156 } // namespace navigation_interception |
| OLD | NEW |