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

Unified Diff: content/browser/renderer_host/overscroll_controller.cc

Issue 2698673006: Add User Actions and adding more details to UMA metrics for overscroll navigation (Closed)
Patch Set: 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/renderer_host/overscroll_controller.cc
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc
index cef841a6c5186eb43a99d7e385230935609c7886..4bcc6d42c6d80d331797219b8c196ea988cdaf7f 100644
--- a/content/browser/renderer_host/overscroll_controller.cc
+++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -124,7 +124,7 @@ bool OverscrollController::WillHandleEvent(const blink::WebInputEvent& event) {
}
if (overscroll_mode_ != OVERSCROLL_NONE && DispatchEventResetsState(event)) {
- SetOverscrollMode(OVERSCROLL_NONE);
+ SetOverscrollMode(OVERSCROLL_NONE, OVERSCROLL_SOURCE_NONE);
// Let the event be dispatched to the renderer.
return false;
@@ -177,7 +177,7 @@ void OverscrollController::Reset() {
}
void OverscrollController::Cancel() {
- SetOverscrollMode(OVERSCROLL_NONE);
+ SetOverscrollMode(OVERSCROLL_NONE, OVERSCROLL_SOURCE_NONE);
overscroll_delta_x_ = overscroll_delta_y_ = 0.f;
scroll_state_ = STATE_UNKNOWN;
}
@@ -320,7 +320,7 @@ bool OverscrollController::ProcessEventForOverscroll(
}
// Reset overscroll state if fling didn't complete the overscroll gesture.
- SetOverscrollMode(OVERSCROLL_NONE);
+ SetOverscrollMode(OVERSCROLL_NONE, OVERSCROLL_SOURCE_NONE);
break;
}
@@ -346,7 +346,7 @@ bool OverscrollController::ProcessOverscroll(float delta_x,
OVERSCROLL_CONFIG_VERT_THRESHOLD_START);
if (fabs(overscroll_delta_x_) <= horiz_threshold &&
fabs(overscroll_delta_y_) <= vert_threshold) {
- SetOverscrollMode(OVERSCROLL_NONE);
+ SetOverscrollMode(OVERSCROLL_NONE, OVERSCROLL_SOURCE_NONE);
return true;
}
@@ -369,9 +369,10 @@ bool OverscrollController::ProcessOverscroll(float delta_x,
new_mode = OVERSCROLL_NONE;
if (overscroll_mode_ == OVERSCROLL_NONE)
mohsen 2017/02/21 20:47:58 nit: Curly braces for multi-line block.
mfomitchev 2017/02/23 02:59:42 Done.
- SetOverscrollMode(new_mode);
+ SetOverscrollMode(
+ new_mode, is_touchpad ? OVERSCROLL_TOUCHPAD : OVERSCROLL_TOUCHSCREEN);
mohsen 2017/02/21 20:47:58 Can the new_mode be NONE? If yes, can the source b
mfomitchev 2017/02/23 02:59:42 Yes. The contract only enforces that source is non
mohsen 2017/02/23 19:19:09 Acknowledged.
else if (new_mode != overscroll_mode_)
- SetOverscrollMode(OVERSCROLL_NONE);
+ SetOverscrollMode(OVERSCROLL_NONE, OVERSCROLL_SOURCE_NONE);
if (overscroll_mode_ == OVERSCROLL_NONE)
return false;
@@ -412,7 +413,8 @@ void OverscrollController::CompleteAction() {
overscroll_delta_x_ = overscroll_delta_y_ = 0.f;
}
-void OverscrollController::SetOverscrollMode(OverscrollMode mode) {
+void OverscrollController::SetOverscrollMode(OverscrollMode mode,
+ OverscrollSource source) {
if (overscroll_mode_ == mode)
return;
OverscrollMode old_mode = overscroll_mode_;
@@ -422,7 +424,7 @@ void OverscrollController::SetOverscrollMode(OverscrollMode mode) {
else
scroll_state_ = STATE_OVERSCROLLING;
if (delegate_)
- delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_);
+ delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_, source);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698