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 "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool has_user_gesture_carryover = | 131 bool has_user_gesture_carryover = |
132 !navigation_params.has_user_gesture() && | 132 !navigation_params.has_user_gesture() && |
133 base::TimeTicks::Now() - last_user_gesture_carryover_timestamp_ <= | 133 base::TimeTicks::Now() - last_user_gesture_carryover_timestamp_ <= |
134 base::TimeDelta::FromSeconds( | 134 base::TimeDelta::FromSeconds( |
135 kMaxValidityOfUserGestureCarryoverInSeconds); | 135 kMaxValidityOfUserGestureCarryoverInSeconds); |
136 | 136 |
137 ScopedJavaLocalRef<jobject> jobject_params = CreateJavaNavigationParams( | 137 ScopedJavaLocalRef<jobject> jobject_params = CreateJavaNavigationParams( |
138 env, navigation_params, has_user_gesture_carryover); | 138 env, navigation_params, has_user_gesture_carryover); |
139 | 139 |
140 return Java_InterceptNavigationDelegate_shouldIgnoreNavigation( | 140 return Java_InterceptNavigationDelegate_shouldIgnoreNavigation( |
141 env, | 141 env, jdelegate, jobject_params); |
142 jdelegate.obj(), | |
143 jobject_params.obj()); | |
144 } | 142 } |
145 | 143 |
146 void InterceptNavigationDelegate::UpdateLastUserGestureCarryoverTimestamp() { | 144 void InterceptNavigationDelegate::UpdateLastUserGestureCarryoverTimestamp() { |
147 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now(); | 145 last_user_gesture_carryover_timestamp_ = base::TimeTicks::Now(); |
148 } | 146 } |
149 | 147 |
150 } // namespace navigation_interception | 148 } // namespace navigation_interception |
OLD | NEW |