| 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/browser/renderer_host/input/input_router_impl.h" | 5 #include "content/browser/renderer_host/input/input_router_impl.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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 TouchEventQueue::TouchScrollingMode GetTouchScrollingMode() { | 88 TouchEventQueue::TouchScrollingMode GetTouchScrollingMode() { |
| 89 std::string modeString = CommandLine::ForCurrentProcess()-> | 89 std::string modeString = CommandLine::ForCurrentProcess()-> |
| 90 GetSwitchValueASCII(switches::kTouchScrollingMode); | 90 GetSwitchValueASCII(switches::kTouchScrollingMode); |
| 91 if (modeString == switches::kTouchScrollingModeSyncTouchmove) | 91 if (modeString == switches::kTouchScrollingModeSyncTouchmove) |
| 92 return TouchEventQueue::TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE; | 92 return TouchEventQueue::TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE; |
| 93 if (modeString == switches::kTouchScrollingModeAbsorbTouchmove) | 93 if (modeString == switches::kTouchScrollingModeAbsorbTouchmove) |
| 94 return TouchEventQueue::TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE; | 94 return TouchEventQueue::TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE; |
| 95 if (modeString != "" && | 95 if (modeString == switches::kTouchScrollingModeTouchcancel) |
| 96 modeString != switches::kTouchScrollingModeTouchcancel) | 96 return TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL; |
| 97 if (modeString != "") |
| 97 LOG(ERROR) << "Invalid --touch-scrolling-mode option: " << modeString; | 98 LOG(ERROR) << "Invalid --touch-scrolling-mode option: " << modeString; |
| 98 return TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT; | 99 return TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT; |
| 99 } | 100 } |
| 100 | 101 |
| 101 GestureEventWithLatencyInfo MakeGestureEvent(WebInputEvent::Type type, | 102 GestureEventWithLatencyInfo MakeGestureEvent(WebInputEvent::Type type, |
| 102 double timestamp_seconds, | 103 double timestamp_seconds, |
| 103 int x, | 104 int x, |
| 104 int y, | 105 int y, |
| 105 int modifiers, | 106 int modifiers, |
| 106 const ui::LatencyInfo latency) { | 107 const ui::LatencyInfo latency) { |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 touch_event_queue_->SetAckTimeoutEnabled(touch_ack_timeout_enabled, | 806 touch_event_queue_->SetAckTimeoutEnabled(touch_ack_timeout_enabled, |
| 806 touch_ack_timeout_delay_ms_); | 807 touch_ack_timeout_delay_ms_); |
| 807 } | 808 } |
| 808 | 809 |
| 809 bool InputRouterImpl::IsInOverscrollGesture() const { | 810 bool InputRouterImpl::IsInOverscrollGesture() const { |
| 810 OverscrollController* controller = client_->GetOverscrollController(); | 811 OverscrollController* controller = client_->GetOverscrollController(); |
| 811 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; | 812 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; |
| 812 } | 813 } |
| 813 | 814 |
| 814 } // namespace content | 815 } // namespace content |
| OLD | NEW |