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

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

Issue 291003002: Move OverscrollController to RenderWidgetHostViewAura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 (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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 9 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
10 #include "content/public/browser/overscroll_configuration.h" 10 #include "content/public/browser/overscroll_configuration.h"
(...skipping 17 matching lines...) Expand all
28 scroll_state_(STATE_UNKNOWN), 28 scroll_state_(STATE_UNKNOWN),
29 overscroll_delta_x_(0.f), 29 overscroll_delta_x_(0.f),
30 overscroll_delta_y_(0.f), 30 overscroll_delta_y_(0.f),
31 delegate_(NULL) { 31 delegate_(NULL) {
32 } 32 }
33 33
34 OverscrollController::~OverscrollController() { 34 OverscrollController::~OverscrollController() {
35 } 35 }
36 36
37 OverscrollController::Disposition OverscrollController::DispatchEvent( 37 OverscrollController::Disposition OverscrollController::DispatchEvent(
38 const blink::WebInputEvent& event, 38 const blink::WebInputEvent& event) {
39 const ui::LatencyInfo& latency_info) {
40 if (scroll_state_ != STATE_UNKNOWN) { 39 if (scroll_state_ != STATE_UNKNOWN) {
41 switch (event.type) { 40 switch (event.type) {
42 case blink::WebInputEvent::GestureScrollEnd: 41 case blink::WebInputEvent::GestureScrollEnd:
43 case blink::WebInputEvent::GestureFlingStart: 42 case blink::WebInputEvent::GestureFlingStart:
44 scroll_state_ = STATE_UNKNOWN; 43 scroll_state_ = STATE_UNKNOWN;
45 break; 44 break;
46 45
47 case blink::WebInputEvent::MouseWheel: { 46 case blink::WebInputEvent::MouseWheel: {
48 const blink::WebMouseWheelEvent& wheel = 47 const blink::WebMouseWheelEvent& wheel =
49 static_cast<const blink::WebMouseWheelEvent&>(event); 48 static_cast<const blink::WebMouseWheelEvent&>(event);
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 overscroll_mode_ = mode; 368 overscroll_mode_ = mode;
370 if (overscroll_mode_ == OVERSCROLL_NONE) 369 if (overscroll_mode_ == OVERSCROLL_NONE)
371 overscroll_delta_x_ = overscroll_delta_y_ = 0.f; 370 overscroll_delta_x_ = overscroll_delta_y_ = 0.f;
372 else 371 else
373 scroll_state_ = STATE_OVERSCROLLING; 372 scroll_state_ = STATE_OVERSCROLLING;
374 if (delegate_) 373 if (delegate_)
375 delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_); 374 delegate_->OnOverscrollModeChange(old_mode, overscroll_mode_);
376 } 375 }
377 376
378 } // namespace content 377 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698