Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: content/browser/web_contents/aura/gesture_nav_simple.cc

Issue 2698673006: Add User Actions and adding more details to UMA metrics for overscroll navigation (Closed)
Patch Set: Trailing period Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/aura/gesture_nav_simple.cc
diff --git a/content/browser/web_contents/aura/gesture_nav_simple.cc b/content/browser/web_contents/aura/gesture_nav_simple.cc
index 17b94bcc97b0006a63472be3bd2fc9836c54af89..7ea7792d86bdced7276e5e099fbf5fac5fd6581e 100644
--- a/content/browser/web_contents/aura/gesture_nav_simple.cc
+++ b/content/browser/web_contents/aura/gesture_nav_simple.cc
@@ -374,7 +374,8 @@ void GestureNavSimple::OnOverscrollComplete(OverscrollMode overscroll_mode) {
}
void GestureNavSimple::OnOverscrollModeChange(OverscrollMode old_mode,
- OverscrollMode new_mode) {
+ OverscrollMode new_mode,
+ OverscrollSource source) {
NavigationControllerImpl& controller = web_contents_->GetController();
if (!ShouldNavigateForward(controller, new_mode) &&
!ShouldNavigateBack(controller, new_mode)) {
@@ -384,10 +385,15 @@ void GestureNavSimple::OnOverscrollModeChange(OverscrollMode old_mode,
aura::Window* window = web_contents_->GetNativeView();
const gfx::Rect& window_bounds = window->bounds();
+ DCHECK_NE(source, OverscrollSource::NONE);
+ float start_threshold = GetOverscrollConfig(
+ source == OverscrollSource::TOUCHPAD
+ ? OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD
+ : OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN);
completion_threshold_ =
window_bounds.width() *
GetOverscrollConfig(OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE) -
- GetOverscrollConfig(OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN);
+ start_threshold;
affordance_.reset(new Affordance(new_mode, window_bounds));

Powered by Google App Engine
This is Rietveld 408576698