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

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

Issue 1566303004: Smooth scroll on Windows should respect OS level animation disabling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master Created 4 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
« no previous file with comments | « content/renderer/input/input_handler_wrapper.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/input/did_overscroll_params.h" 9 #include "content/common/input/did_overscroll_params.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
11 #include "content/renderer/input/input_event_filter.h" 11 #include "content/renderer/input/input_event_filter.h"
12 #include "content/renderer/input/input_handler_manager.h" 12 #include "content/renderer/input/input_handler_manager.h"
13 #include "third_party/WebKit/public/platform/Platform.h" 13 #include "third_party/WebKit/public/platform/Platform.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 InputHandlerWrapper::InputHandlerWrapper( 17 InputHandlerWrapper::InputHandlerWrapper(
18 InputHandlerManager* input_handler_manager, 18 InputHandlerManager* input_handler_manager,
19 int routing_id, 19 int routing_id,
20 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, 20 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
21 const base::WeakPtr<cc::InputHandler>& input_handler, 21 const base::WeakPtr<cc::InputHandler>& input_handler,
22 const base::WeakPtr<RenderViewImpl>& render_view_impl) 22 const base::WeakPtr<RenderViewImpl>& render_view_impl,
23 bool enable_smooth_scrolling)
23 : input_handler_manager_(input_handler_manager), 24 : input_handler_manager_(input_handler_manager),
24 routing_id_(routing_id), 25 routing_id_(routing_id),
25 input_handler_proxy_(input_handler.get(), this), 26 input_handler_proxy_(input_handler.get(), this),
26 main_task_runner_(main_task_runner), 27 main_task_runner_(main_task_runner),
27 render_view_impl_(render_view_impl) { 28 render_view_impl_(render_view_impl) {
28 DCHECK(input_handler); 29 DCHECK(input_handler);
29 input_handler_proxy_.set_smooth_scroll_enabled( 30 input_handler_proxy_.set_smooth_scroll_enabled(enable_smooth_scrolling);
30 !base::CommandLine::ForCurrentProcess()->HasSwitch(
31 switches::kDisableSmoothScrolling));
32 } 31 }
33 32
34 InputHandlerWrapper::~InputHandlerWrapper() { 33 InputHandlerWrapper::~InputHandlerWrapper() {
35 } 34 }
36 35
37 void InputHandlerWrapper::TransferActiveWheelFlingAnimation( 36 void InputHandlerWrapper::TransferActiveWheelFlingAnimation(
38 const blink::WebActiveWheelFlingParameters& params) { 37 const blink::WebActiveWheelFlingParameters& params) {
39 main_task_runner_->PostTask( 38 main_task_runner_->PostTask(
40 FROM_HERE, base::Bind(&RenderViewImpl::TransferActiveWheelFlingAnimation, 39 FROM_HERE, base::Bind(&RenderViewImpl::TransferActiveWheelFlingAnimation,
41 render_view_impl_, params)); 40 render_view_impl_, params));
(...skipping 26 matching lines...) Expand all
68 67
69 void InputHandlerWrapper::DidStopFlinging() { 68 void InputHandlerWrapper::DidStopFlinging() {
70 input_handler_manager_->DidStopFlinging(routing_id_); 69 input_handler_manager_->DidStopFlinging(routing_id_);
71 } 70 }
72 71
73 void InputHandlerWrapper::DidAnimateForInput() { 72 void InputHandlerWrapper::DidAnimateForInput() {
74 input_handler_manager_->DidAnimateForInput(); 73 input_handler_manager_->DidAnimateForInput();
75 } 74 }
76 75
77 } // namespace content 76 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/input_handler_wrapper.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698