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

Side by Side Diff: content/renderer/input/input_handler_wrapper.cc

Issue 2625453002: Touchpad and wheel scroll latching for ChromeOS behind flag. (Closed)
Patch Set: ScrollEnd gets called when the fling ends before hitting a scroll extent. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/input/input_handler_wrapper.h" 5 #include "content/renderer/input/input_handler_wrapper.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "content/public/common/content_features.h"
9 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
10 #include "content/renderer/input/input_event_filter.h" 11 #include "content/renderer/input/input_event_filter.h"
11 #include "content/renderer/input/input_handler_manager.h" 12 #include "content/renderer/input/input_handler_manager.h"
12 #include "third_party/WebKit/public/platform/Platform.h" 13 #include "third_party/WebKit/public/platform/Platform.h"
13 #include "ui/events/blink/did_overscroll_params.h" 14 #include "ui/events/blink/did_overscroll_params.h"
14 15
15 namespace content { 16 namespace content {
16 17
17 InputHandlerWrapper::InputHandlerWrapper( 18 InputHandlerWrapper::InputHandlerWrapper(
18 InputHandlerManager* input_handler_manager, 19 InputHandlerManager* input_handler_manager,
19 int routing_id, 20 int routing_id,
20 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, 21 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
21 const base::WeakPtr<cc::InputHandler>& input_handler, 22 const base::WeakPtr<cc::InputHandler>& input_handler,
22 const base::WeakPtr<RenderViewImpl>& render_view_impl, 23 const base::WeakPtr<RenderViewImpl>& render_view_impl,
23 bool enable_smooth_scrolling) 24 bool enable_smooth_scrolling)
24 : input_handler_manager_(input_handler_manager), 25 : input_handler_manager_(input_handler_manager),
25 routing_id_(routing_id), 26 routing_id_(routing_id),
26 input_handler_proxy_(input_handler.get(), this), 27 input_handler_proxy_(input_handler.get(), this),
27 main_task_runner_(main_task_runner), 28 main_task_runner_(main_task_runner),
28 render_view_impl_(render_view_impl) { 29 render_view_impl_(render_view_impl) {
29 DCHECK(input_handler); 30 DCHECK(input_handler);
30 input_handler_proxy_.set_smooth_scroll_enabled(enable_smooth_scrolling); 31 input_handler_proxy_.set_smooth_scroll_enabled(enable_smooth_scrolling);
32 input_handler_proxy_.set_touchpad_and_wheel_scroll_latching_enabled(
33 base::FeatureList::IsEnabled(features::kTouchpadAndWheelScrollLatching));
31 } 34 }
32 35
33 InputHandlerWrapper::~InputHandlerWrapper() { 36 InputHandlerWrapper::~InputHandlerWrapper() {
34 } 37 }
35 38
36 void InputHandlerWrapper::NeedsMainFrame() { 39 void InputHandlerWrapper::NeedsMainFrame() {
37 main_task_runner_->PostTask( 40 main_task_runner_->PostTask(
38 FROM_HERE, 41 FROM_HERE,
39 base::Bind(&RenderViewImpl::SetNeedsMainFrame, render_view_impl_)); 42 base::Bind(&RenderViewImpl::SetNeedsMainFrame, render_view_impl_));
40 } 43 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 83
81 void InputHandlerWrapper::DidStopFlinging() { 84 void InputHandlerWrapper::DidStopFlinging() {
82 input_handler_manager_->DidStopFlinging(routing_id_); 85 input_handler_manager_->DidStopFlinging(routing_id_);
83 } 86 }
84 87
85 void InputHandlerWrapper::DidAnimateForInput() { 88 void InputHandlerWrapper::DidAnimateForInput() {
86 input_handler_manager_->DidAnimateForInput(); 89 input_handler_manager_->DidAnimateForInput();
87 } 90 }
88 91
89 } // namespace content 92 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698