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

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

Issue 478023002: OverscrollController consumes scroll updates only during gesture-nav. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 completed_mode_ = OVERSCROLL_NONE; 116 completed_mode_ = OVERSCROLL_NONE;
117 delta_x_ = delta_y_ = 0.f; 117 delta_x_ = delta_y_ = 0.f;
118 } 118 }
119 119
120 private: 120 private:
121 // Overridden from OverscrollControllerDelegate: 121 // Overridden from OverscrollControllerDelegate:
122 virtual gfx::Rect GetVisibleBounds() const OVERRIDE { 122 virtual gfx::Rect GetVisibleBounds() const OVERRIDE {
123 return view_->IsShowing() ? view_->GetViewBounds() : gfx::Rect(); 123 return view_->IsShowing() ? view_->GetViewBounds() : gfx::Rect();
124 } 124 }
125 125
126 virtual void OnOverscrollUpdate(float delta_x, float delta_y) OVERRIDE { 126 virtual bool OnOverscrollUpdate(float delta_x, float delta_y) OVERRIDE {
127 delta_x_ = delta_x; 127 delta_x_ = delta_x;
128 delta_y_ = delta_y; 128 delta_y_ = delta_y;
129 return true;
129 } 130 }
130 131
131 virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) OVERRIDE { 132 virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) OVERRIDE {
132 EXPECT_EQ(current_mode_, overscroll_mode); 133 EXPECT_EQ(current_mode_, overscroll_mode);
133 completed_mode_ = overscroll_mode; 134 completed_mode_ = overscroll_mode;
134 current_mode_ = OVERSCROLL_NONE; 135 current_mode_ = OVERSCROLL_NONE;
135 } 136 }
136 137
137 virtual void OnOverscrollModeChange(OverscrollMode old_mode, 138 virtual void OnOverscrollModeChange(OverscrollMode old_mode,
138 OverscrollMode new_mode) OVERRIDE { 139 OverscrollMode new_mode) OVERRIDE {
(...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode()); 2718 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode());
2718 2719
2719 SimulateGestureEvent(WebInputEvent::GestureScrollEnd, 2720 SimulateGestureEvent(WebInputEvent::GestureScrollEnd,
2720 blink::WebGestureDeviceTouchscreen); 2721 blink::WebGestureDeviceTouchscreen);
2721 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); 2722 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode());
2722 EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode()); 2723 EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode());
2723 EXPECT_EQ(3U, sink_->message_count()); 2724 EXPECT_EQ(3U, sink_->message_count());
2724 } 2725 }
2725 2726
2726 } // namespace content 2727 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698