Chromium Code Reviews| Index: cc/trees/layer_tree_host.cc |
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
| index 7d4b70c5aa0d20625061b4ab508d424632e8a488..a7cedcbc3ddb9826958be04b6a76c4e655884a4d 100644 |
| --- a/cc/trees/layer_tree_host.cc |
| +++ b/cc/trees/layer_tree_host.cc |
| @@ -737,6 +737,31 @@ void LayerTreeHost::ApplyViewportDeltas(ScrollAndScaleSet* info) { |
| SetNeedsUpdateLayers(); |
| } |
| +void LayerTreeHost::RecordWheelAndTouchScrollingCount(ScrollAndScaleSet* info) { |
| + bool has_scrolled_by_wheel = false; |
| + bool has_scrolled_by_touch = false; |
| + |
| + if (!info) |
| + return; |
| + |
| + switch (info->scroll_source_info) { |
| + case InputHandler::ScrollSourceInfo::NONE: |
| + break; |
|
dtapuska
2017/03/08 21:18:00
Can you return here?
sahel
2017/03/10 16:21:33
Done.
|
| + case InputHandler::ScrollSourceInfo::SCROLLED_BY_TOUCH: |
| + has_scrolled_by_touch = true; |
| + break; |
| + case InputHandler::ScrollSourceInfo::SCROLLED_BY_WHEEL: |
| + has_scrolled_by_wheel = true; |
| + break; |
| + case InputHandler::ScrollSourceInfo::SCROLLED_BY_TOUCH_AND_WHEEL: |
| + has_scrolled_by_wheel = true; |
| + has_scrolled_by_touch = true; |
| + break; |
| + } |
| + client_->RecordWheelAndTouchScrollingCount(has_scrolled_by_wheel, |
| + has_scrolled_by_touch); |
| +} |
| + |
| void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) { |
| for (auto& swap_promise : info->swap_promises) { |
| TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", |
| @@ -767,6 +792,8 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) { |
| // controls from clamping the layout viewport both on the compositor and |
| // on the main thread. |
| ApplyViewportDeltas(info); |
| + |
| + RecordWheelAndTouchScrollingCount(info); |
| } |
| const base::WeakPtr<InputHandler>& LayerTreeHost::GetInputHandler() |