OLD | NEW |
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_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 gesture_scroll_on_impl_thread_(false), | 183 gesture_scroll_on_impl_thread_(false), |
184 gesture_pinch_on_impl_thread_(false), | 184 gesture_pinch_on_impl_thread_(false), |
185 fling_may_be_active_on_main_thread_(false), | 185 fling_may_be_active_on_main_thread_(false), |
186 disallow_horizontal_fling_scroll_(false), | 186 disallow_horizontal_fling_scroll_(false), |
187 disallow_vertical_fling_scroll_(false), | 187 disallow_vertical_fling_scroll_(false), |
188 has_fling_animation_started_(false), | 188 has_fling_animation_started_(false), |
189 uma_latency_reporting_enabled_( | 189 uma_latency_reporting_enabled_( |
190 base::TimeTicks::IsHighResNowFastAndReliable()) { | 190 base::TimeTicks::IsHighResNowFastAndReliable()) { |
191 DCHECK(client); | 191 DCHECK(client); |
192 input_handler_->BindToClient(this); | 192 input_handler_->BindToClient(this); |
193 smooth_scroll_enabled_ = CommandLine::ForCurrentProcess()->HasSwitch( | 193 smooth_scroll_enabled_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
194 switches::kEnableSmoothScrolling); | 194 switches::kEnableSmoothScrolling); |
195 | 195 |
196 #if defined(OS_MACOSX) | 196 #if defined(OS_MACOSX) |
197 if (CommandLine::ForCurrentProcess()->HasSwitch( | 197 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
198 switches::kEnableThreadedEventHandlingMac)) { | 198 switches::kEnableThreadedEventHandlingMac)) { |
199 scroll_elasticity_controller_.reset(new InputScrollElasticityController( | 199 scroll_elasticity_controller_.reset(new InputScrollElasticityController( |
200 input_handler_->CreateScrollElasticityHelper())); | 200 input_handler_->CreateScrollElasticityHelper())); |
201 } | 201 } |
202 #endif | 202 #endif |
203 } | 203 } |
204 | 204 |
205 InputHandlerProxy::~InputHandlerProxy() {} | 205 InputHandlerProxy::~InputHandlerProxy() {} |
206 | 206 |
207 void InputHandlerProxy::WillShutdown() { | 207 void InputHandlerProxy::WillShutdown() { |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 921 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
922 // Return true in this case to prevent early fling termination. | 922 // Return true in this case to prevent early fling termination. |
923 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 923 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
924 std::abs(clipped_increment.height) < kScrollEpsilon) | 924 std::abs(clipped_increment.height) < kScrollEpsilon) |
925 return true; | 925 return true; |
926 | 926 |
927 return did_scroll; | 927 return did_scroll; |
928 } | 928 } |
929 | 929 |
930 } // namespace content | 930 } // namespace content |
OLD | NEW |