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

Side by Side Diff: content/browser/renderer_host/overscroll_controller.cc

Issue 14999012: Move cc/debug/latency_info to ui/base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/overscroll_controller.h" 5 #include "content/browser/renderer_host/overscroll_controller.h"
6 6
7 #include "content/browser/renderer_host/gesture_event_filter.h" 7 #include "content/browser/renderer_host/gesture_event_filter.h"
8 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 8 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/public/browser/overscroll_configuration.h" 10 #include "content/public/browser/overscroll_configuration.h"
11 #include "content/public/browser/render_widget_host_view.h" 11 #include "content/public/browser/render_widget_host_view.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 OverscrollController::OverscrollController( 15 OverscrollController::OverscrollController(
16 RenderWidgetHostImpl* render_widget_host) 16 RenderWidgetHostImpl* render_widget_host)
17 : render_widget_host_(render_widget_host), 17 : render_widget_host_(render_widget_host),
18 overscroll_mode_(OVERSCROLL_NONE), 18 overscroll_mode_(OVERSCROLL_NONE),
19 scroll_state_(STATE_UNKNOWN), 19 scroll_state_(STATE_UNKNOWN),
20 overscroll_delta_x_(0.f), 20 overscroll_delta_x_(0.f),
21 overscroll_delta_y_(0.f), 21 overscroll_delta_y_(0.f),
22 delegate_(NULL) { 22 delegate_(NULL) {
23 } 23 }
24 24
25 OverscrollController::~OverscrollController() { 25 OverscrollController::~OverscrollController() {
26 } 26 }
27 27
28 bool OverscrollController::WillDispatchEvent( 28 bool OverscrollController::WillDispatchEvent(
29 const WebKit::WebInputEvent& event, 29 const WebKit::WebInputEvent& event,
30 const cc::LatencyInfo& latency_info) { 30 const ui::LatencyInfo& latency_info) {
31 if (scroll_state_ != STATE_UNKNOWN) { 31 if (scroll_state_ != STATE_UNKNOWN) {
32 if (event.type == WebKit::WebInputEvent::GestureScrollEnd) { 32 if (event.type == WebKit::WebInputEvent::GestureScrollEnd) {
33 scroll_state_ = STATE_UNKNOWN; 33 scroll_state_ = STATE_UNKNOWN;
34 } else if (event.type == WebKit::WebInputEvent::GestureFlingStart) { 34 } else if (event.type == WebKit::WebInputEvent::GestureFlingStart) {
35 // Start of a fling indicates the end of a scroll, both from touchpad and 35 // Start of a fling indicates the end of a scroll, both from touchpad and
36 // touchscreen. So it is not necessary to check |sourceDevice| of the 36 // touchscreen. So it is not necessary to check |sourceDevice| of the
37 // event. 37 // event.
38 scroll_state_ = STATE_UNKNOWN; 38 scroll_state_ = STATE_UNKNOWN;
39 } else if (event.type == WebKit::WebInputEvent::MouseWheel) { 39 } else if (event.type == WebKit::WebInputEvent::MouseWheel) {
40 const WebKit::WebMouseWheelEvent& wheel = 40 const WebKit::WebMouseWheelEvent& wheel =
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 const WebKit::WebInputEvent& event) const { 335 const WebKit::WebInputEvent& event) const {
336 if (!WebKit::WebInputEvent::isGestureEventType(event.type)) 336 if (!WebKit::WebInputEvent::isGestureEventType(event.type))
337 return false; 337 return false;
338 338
339 // If the GestureEventFilter already processed this event, then the event must 339 // If the GestureEventFilter already processed this event, then the event must
340 // not be sent to the filter again. 340 // not be sent to the filter again.
341 return !render_widget_host_->gesture_event_filter()->HasQueuedGestureEvents(); 341 return !render_widget_host_->gesture_event_filter()->HasQueuedGestureEvents();
342 } 342 }
343 343
344 } // namespace content 344 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/overscroll_controller.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698