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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2773893003: Record size of scroller that user scrolls (Closed)
Patch Set: Address comments && add unit tests Created 3 years, 8 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: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index c3005c8a4bfaa15b1db877b8618f0f341f2d64fc..b50177aca1d8de6823a72c5efe8121f3d3cbfbe7 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -36,6 +36,7 @@
#include "cc/input/scroll_elasticity_helper.h"
#include "cc/input/scroll_state.h"
#include "cc/input/scrollbar_animation_controller.h"
+#include "cc/input/scroller_size.h"
#include "cc/layers/append_quads_data.h"
#include "cc/layers/effect_tree_layer_list_iterator.h"
#include "cc/layers/heads_up_display_layer_impl.h"
@@ -2768,6 +2769,24 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
scrolling_node = FindScrollNodeForDeviceViewportPoint(
device_viewport_point, type, layer_impl, &scroll_on_main_thread,
&scroll_status.main_thread_scrolling_reasons);
+ if (!scroll_on_main_thread && scrolling_node &&
+ InnerViewportScrollLayer() && OuterViewportScrollLayer() &&
flackr 2017/04/20 07:15:01 Why do we need to have a inner and outer viewport
bokan 2017/04/20 14:34:06 I think it's meant to null check the conditions be
+ scrolling_node->element_id !=
+ InnerViewportScrollLayer()->element_id() &&
+ scrolling_node->element_id !=
+ OuterViewportScrollLayer()->element_id()) {
+ if (IsWheelBasedScroll(type)) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Scroll.ScrollerSize.OnScroll_Wheel",
+ scrolling_node->scroll_clip_layer_bounds.GetArea(), 1,
+ kMaxScrollerSize, kScrollerSizeBucketCount);
+ } else {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Scroll.ScrollerSize.OnScroll_Touch",
+ scrolling_node->scroll_clip_layer_bounds.GetArea(), 1,
+ kMaxScrollerSize, kScrollerSizeBucketCount);
+ }
+ }
}
if (scroll_on_main_thread) {

Powered by Google App Engine
This is Rietveld 408576698