summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-29 17:35:12 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-29 17:35:12 +0000
commit5ff3c978773facb8b91a4791fcf10e486a250c8d (patch)
treeb5fe8f9683746b2e4db878d5e10a773ec6a87cdd /cc
parent63e0a90cf78abdfa2f11aa4aeae7908d054ad90e (diff)
downloadchromium_src-5ff3c978773facb8b91a4791fcf10e486a250c8d.zip
chromium_src-5ff3c978773facb8b91a4791fcf10e486a250c8d.tar.gz
chromium_src-5ff3c978773facb8b91a4791fcf10e486a250c8d.tar.bz2
Flip the cc::InputHandler and cc::InputHandlerClient names, they are backwards
The names for the InputHandler and InputHandlerClient are backwards and super confusing. The InputHandler is the thing that does interesting things with inputs, like scroll and fling and pinch and such. The Client is the thing that receives control messages like animation and fling over updates. (╯°□°)╯︵ ┻━┻) Review URL: https://chromiumcodereview.appspot.com/14021024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/input/input_handler.h32
-rw-r--r--cc/layers/layer_impl.cc20
-rw-r--r--cc/layers/layer_impl.h4
-rw-r--r--cc/layers/scrollbar_layer_unittest.cc8
-rw-r--r--cc/test/fake_layer_tree_host_client.cc5
-rw-r--r--cc/test/fake_layer_tree_host_client.h2
-rw-r--r--cc/test/layer_tree_test.cc4
-rw-r--r--cc/trees/layer_tree_host.cc4
-rw-r--r--cc/trees/layer_tree_host.h2
-rw-r--r--cc/trees/layer_tree_host_client.h4
-rw-r--r--cc/trees/layer_tree_host_impl.cc6
-rw-r--r--cc/trees/layer_tree_host_impl.h10
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc196
-rw-r--r--cc/trees/layer_tree_host_unittest_scroll.cc36
-rw-r--r--cc/trees/thread_proxy.cc28
-rw-r--r--cc/trees/thread_proxy.h6
16 files changed, 184 insertions, 183 deletions
diff --git a/cc/input/input_handler.h b/cc/input/input_handler.h
index 267e631..0d943df 100644
--- a/cc/input/input_handler.h
+++ b/cc/input/input_handler.h
@@ -19,15 +19,11 @@ class Vector2dF;
namespace cc {
-// The InputHandler is a way for the embedders to interact with
-// the impl thread side of the compositor implementation.
-//
-// There is one InputHandler for every LayerTreeHost. It is
-// created on the main thread and used only on the impl thread.
-//
-// The InputHandler is constructed with a InputHandlerClient, which is the
-// interface by which the handler can manipulate the LayerTree.
-class CC_EXPORT InputHandlerClient {
+// The InputHandler is a way for the embedders to interact with the impl thread
+// side of the compositor implementation. There is one InputHandler per
+// LayerTreeHost. To use the input handler, implement the InputHanderClient
+// interface and bind it to the handler on the compositor thread.
+class CC_EXPORT InputHandler {
public:
enum ScrollStatus { ScrollOnMainThread, ScrollStarted, ScrollIgnored };
enum ScrollInputType { Gesture, Wheel, NonBubblingGesture };
@@ -74,7 +70,7 @@ class CC_EXPORT InputHandlerClient {
base::TimeTicks start_time,
base::TimeDelta duration) = 0;
- // Request another callback to InputHandler::Animate().
+ // Request another callback to InputHandlerClient::Animate().
virtual void ScheduleAnimation() = 0;
virtual bool HaveTouchEventHandlersAt(gfx::Point viewport_point) = 0;
@@ -83,26 +79,26 @@ class CC_EXPORT InputHandlerClient {
base::TimeTicks frame_time) = 0;
protected:
- InputHandlerClient() {}
- virtual ~InputHandlerClient() {}
+ InputHandler() {}
+ virtual ~InputHandler() {}
private:
- DISALLOW_COPY_AND_ASSIGN(InputHandlerClient);
+ DISALLOW_COPY_AND_ASSIGN(InputHandler);
};
-class CC_EXPORT InputHandler {
+class CC_EXPORT InputHandlerClient {
public:
- virtual ~InputHandler() {}
+ virtual ~InputHandlerClient() {}
- virtual void BindToClient(InputHandlerClient* client) = 0;
+ virtual void BindToHandler(InputHandler* handler) = 0;
virtual void Animate(base::TimeTicks time) = 0;
virtual void MainThreadHasStoppedFlinging() = 0;
protected:
- InputHandler() {}
+ InputHandlerClient() {}
private:
- DISALLOW_COPY_AND_ASSIGN(InputHandler);
+ DISALLOW_COPY_AND_ASSIGN(InputHandlerClient);
};
} // namespace cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index e64c65e..b9db1140 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -251,17 +251,17 @@ gfx::Vector2dF LayerImpl::ScrollBy(gfx::Vector2dF scroll) {
return unscrolled;
}
-InputHandlerClient::ScrollStatus LayerImpl::TryScroll(
+InputHandler::ScrollStatus LayerImpl::TryScroll(
gfx::PointF screen_space_point,
- InputHandlerClient::ScrollInputType type) const {
+ InputHandler::ScrollInputType type) const {
if (should_scroll_on_main_thread()) {
TRACE_EVENT0("cc", "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread");
- return InputHandlerClient::ScrollOnMainThread;
+ return InputHandler::ScrollOnMainThread;
}
if (!screen_space_transform().IsInvertible()) {
TRACE_EVENT0("cc", "LayerImpl::TryScroll: Ignored NonInvertibleTransform");
- return InputHandlerClient::ScrollIgnored;
+ return InputHandler::ScrollIgnored;
}
if (!non_fast_scrollable_region().IsEmpty()) {
@@ -287,28 +287,28 @@ InputHandlerClient::ScrollStatus LayerImpl::TryScroll(
gfx::ToRoundedPoint(hit_test_point_in_layer_space))) {
TRACE_EVENT0("cc",
"LayerImpl::tryScroll: Failed NonFastScrollableRegion");
- return InputHandlerClient::ScrollOnMainThread;
+ return InputHandler::ScrollOnMainThread;
}
}
- if (type == InputHandlerClient::Wheel && have_wheel_event_handlers()) {
+ if (type == InputHandler::Wheel && have_wheel_event_handlers()) {
TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed WheelEventHandlers");
- return InputHandlerClient::ScrollOnMainThread;
+ return InputHandler::ScrollOnMainThread;
}
if (!scrollable()) {
TRACE_EVENT0("cc", "LayerImpl::tryScroll: Ignored not scrollable");
- return InputHandlerClient::ScrollIgnored;
+ return InputHandler::ScrollIgnored;
}
if (max_scroll_offset_.x() <= 0 && max_scroll_offset_.y() <= 0) {
TRACE_EVENT0("cc",
"LayerImpl::tryScroll: Ignored. Technically scrollable,"
" but has no affordance in either direction.");
- return InputHandlerClient::ScrollIgnored;
+ return InputHandler::ScrollIgnored;
}
- return InputHandlerClient::ScrollStarted;
+ return InputHandler::ScrollStarted;
}
bool LayerImpl::DrawCheckerboardForMissingTiles() const {
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 91b7e7e..697676e 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -336,9 +336,9 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
}
bool DrawCheckerboardForMissingTiles() const;
- InputHandlerClient::ScrollStatus TryScroll(
+ InputHandler::ScrollStatus TryScroll(
gfx::PointF screen_space_point,
- InputHandlerClient::ScrollInputType type) const;
+ InputHandler::ScrollInputType type) const;
void SetDoubleSided(bool double_sided);
bool double_sided() const { return double_sided_; }
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index 148a202..6d3913a 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -100,9 +100,9 @@ TEST(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) {
// When the scrollbar is not an overlay scrollbar, the scroll should be
// responded to on the main thread as the compositor does not yet implement
// scrollbar scrolling.
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
scrollbar_layer_impl->TryScroll(gfx::Point(0, 0),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
// Create and attach an overlay scrollbar.
scrollbar = FakeWebScrollbar::Create();
@@ -115,9 +115,9 @@ TEST(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) {
// The user shouldn't be able to drag an overlay scrollbar and the scroll
// may be handled in the compositor.
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
+ EXPECT_EQ(InputHandler::ScrollIgnored,
scrollbar_layer_impl->TryScroll(gfx::Point(0, 0),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
}
TEST(ScrollbarLayerTest, ScrollOffsetSynchronization) {
diff --git a/cc/test/fake_layer_tree_host_client.cc b/cc/test/fake_layer_tree_host_client.cc
index a9baa8b..f7cc87a 100644
--- a/cc/test/fake_layer_tree_host_client.cc
+++ b/cc/test/fake_layer_tree_host_client.cc
@@ -42,8 +42,9 @@ scoped_ptr<OutputSurface> FakeLayerTreeHostClient::CreateOutputSurface() {
.PassAs<OutputSurface>();
}
-scoped_ptr<InputHandler> FakeLayerTreeHostClient::CreateInputHandler() {
- return scoped_ptr<InputHandler>();
+scoped_ptr<InputHandlerClient>
+FakeLayerTreeHostClient::CreateInputHandlerClient() {
+ return scoped_ptr<InputHandlerClient>();
}
scoped_refptr<cc::ContextProvider> FakeLayerTreeHostClient::
diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h
index 710615b..a25063a 100644
--- a/cc/test/fake_layer_tree_host_client.h
+++ b/cc/test/fake_layer_tree_host_client.h
@@ -33,7 +33,7 @@ class FakeLayerTreeHostClient : public LayerTreeHostClient {
virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE;
virtual void DidRecreateOutputSurface(bool success) OVERRIDE {}
- virtual scoped_ptr<InputHandler> CreateInputHandler() OVERRIDE;
+ virtual scoped_ptr<InputHandlerClient> CreateInputHandlerClient() OVERRIDE;
virtual void WillCommit() OVERRIDE {}
virtual void DidCommit() OVERRIDE {}
virtual void DidCommitAndDrawFrame() OVERRIDE {}
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index e880510..65e2778 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -260,8 +260,8 @@ class LayerTreeHostClientForTesting : public LayerTreeHostClient {
test_hooks_->WillRetryRecreateOutputSurface();
}
- virtual scoped_ptr<InputHandler> CreateInputHandler() OVERRIDE {
- return scoped_ptr<InputHandler>();
+ virtual scoped_ptr<InputHandlerClient> CreateInputHandlerClient() OVERRIDE {
+ return scoped_ptr<InputHandlerClient>();
}
virtual void WillCommit() OVERRIDE {}
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index d760457..6d15bca 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -476,8 +476,8 @@ scoped_ptr<OutputSurface> LayerTreeHost::CreateOutputSurface() {
return client_->CreateOutputSurface();
}
-scoped_ptr<InputHandler> LayerTreeHost::CreateInputHandler() {
- return client_->CreateInputHandler();
+scoped_ptr<InputHandlerClient> LayerTreeHost::CreateInputHandlerClient() {
+ return client_->CreateInputHandlerClient();
}
scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl(
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index f94066d..e6e86f3 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -113,7 +113,7 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
void WillCommit();
void CommitComplete();
scoped_ptr<OutputSurface> CreateOutputSurface();
- scoped_ptr<InputHandler> CreateInputHandler();
+ scoped_ptr<InputHandlerClient> CreateInputHandlerClient();
virtual scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl(
LayerTreeHostImplClient* client);
void DidLoseOutputSurface();
diff --git a/cc/trees/layer_tree_host_client.h b/cc/trees/layer_tree_host_client.h
index 4bc913c..0bef011 100644
--- a/cc/trees/layer_tree_host_client.h
+++ b/cc/trees/layer_tree_host_client.h
@@ -14,7 +14,7 @@ class Vector2d;
namespace cc {
class ContextProvider;
-class InputHandler;
+class InputHandlerClient;
class OutputSurface;
class LayerTreeHostClient {
@@ -29,7 +29,7 @@ class LayerTreeHostClient {
float page_scale) = 0;
virtual scoped_ptr<OutputSurface> CreateOutputSurface() = 0;
virtual void DidRecreateOutputSurface(bool success) = 0;
- virtual scoped_ptr<InputHandler> CreateInputHandler() = 0;
+ virtual scoped_ptr<InputHandlerClient> CreateInputHandlerClient() = 0;
virtual void WillCommit() = 0;
virtual void DidCommit() = 0;
virtual void DidCommitAndDrawFrame() = 0;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 2b708bb..69ecc85 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1459,8 +1459,8 @@ bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() {
return !active_tree_->RenderSurfaceLayerList().empty();
}
-InputHandlerClient::ScrollStatus LayerTreeHostImpl::ScrollBegin(
- gfx::Point viewport_point, InputHandlerClient::ScrollInputType type) {
+InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
+ gfx::Point viewport_point, InputHandler::ScrollInputType type) {
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin");
if (top_controls_manager_)
@@ -1755,7 +1755,7 @@ void LayerTreeHostImpl::ScrollEnd() {
StartScrollbarAnimation(CurrentFrameTimeTicks());
}
-InputHandlerClient::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
+InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
if (active_tree_->CurrentlyScrollingLayer())
return ScrollStarted;
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 612d718..ed599b0 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -81,7 +81,7 @@ class LayerTreeHostImplClient {
// LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering
// state.
-class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient,
+class CC_EXPORT LayerTreeHostImpl : public InputHandler,
public RendererClient,
public TileManagerClient,
public OutputSurfaceClient,
@@ -94,17 +94,17 @@ class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient,
RenderingStatsInstrumentation* rendering_stats_instrumentation);
virtual ~LayerTreeHostImpl();
- // InputHandlerClient implementation
- virtual InputHandlerClient::ScrollStatus ScrollBegin(
+ // InputHandler implementation
+ virtual InputHandler::ScrollStatus ScrollBegin(
gfx::Point viewport_point,
- InputHandlerClient::ScrollInputType type) OVERRIDE;
+ InputHandler::ScrollInputType type) OVERRIDE;
virtual bool ScrollBy(gfx::Point viewport_point,
gfx::Vector2dF scroll_delta) OVERRIDE;
virtual bool ScrollVerticallyByPage(
gfx::Point viewport_point,
WebKit::WebScrollbar::ScrollDirection direction) OVERRIDE;
virtual void ScrollEnd() OVERRIDE;
- virtual InputHandlerClient::ScrollStatus FlingScrollBegin() OVERRIDE;
+ virtual InputHandler::ScrollStatus FlingScrollBegin() OVERRIDE;
virtual void PinchGestureBegin() OVERRIDE;
virtual void PinchGestureUpdate(float magnify_delta,
gfx::Point anchor) OVERRIDE;
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 3782a45..ce2add2 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -406,8 +406,8 @@ TEST_F(LayerTreeHostImplTest, ScrollRootCallsCommitAndRedraw) {
host_impl_->SetViewportSize(gfx::Size(50, 50));
InitializeRendererAndDrawFrame();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
EXPECT_TRUE(did_request_redraw_);
@@ -416,8 +416,8 @@ TEST_F(LayerTreeHostImplTest, ScrollRootCallsCommitAndRedraw) {
TEST_F(LayerTreeHostImplTest, ScrollWithoutRootLayer) {
// We should not crash when trying to scroll an empty layer tree.
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollIgnored,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
}
TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) {
@@ -438,8 +438,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) {
// We should not crash when trying to scroll after the renderer initialization
// fails.
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollIgnored,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
}
TEST_F(LayerTreeHostImplTest, ReplaceTreeWhileScrolling) {
@@ -450,8 +450,8 @@ TEST_F(LayerTreeHostImplTest, ReplaceTreeWhileScrolling) {
InitializeRendererAndDrawFrame();
// We should not crash if the tree is replaced while we are scrolling.
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
host_impl_->active_tree()->DetachLayerTree();
SetupScrollAndContentsLayers(gfx::Size(100, 100));
@@ -475,8 +475,8 @@ TEST_F(LayerTreeHostImplTest, ClearRootRenderSurfaceAndScroll) {
host_impl_->active_tree()->root_layer()->ClearRenderSurface();
host_impl_->active_tree()->set_needs_update_draw_properties();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
}
TEST_F(LayerTreeHostImplTest, WheelEventHandlers) {
@@ -489,12 +489,12 @@ TEST_F(LayerTreeHostImplTest, WheelEventHandlers) {
// With registered event handlers, wheel scrolls have to go to the main
// thread.
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
// But gesture scrolls can still be handled.
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Gesture));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
}
TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchscreen) {
@@ -503,15 +503,15 @@ TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchscreen) {
InitializeRendererAndDrawFrame();
// Ignore the fling since no layer is being scrolled
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
+ EXPECT_EQ(InputHandler::ScrollIgnored,
host_impl_->FlingScrollBegin());
// Start scrolling a layer
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Gesture));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
// Now the fling should go ahead since we've started scrolling a layer
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->FlingScrollBegin());
}
@@ -521,15 +521,15 @@ TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchpad) {
InitializeRendererAndDrawFrame();
// Ignore the fling since no layer is being scrolled
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
+ EXPECT_EQ(InputHandler::ScrollIgnored,
host_impl_->FlingScrollBegin());
// Start scrolling a layer
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
// Now the fling should go ahead since we've started scrolling a layer
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->FlingScrollBegin());
}
@@ -542,11 +542,11 @@ TEST_F(LayerTreeHostImplTest, NoFlingWhenScrollingOnMain) {
root->SetShouldScrollOnMainThread(true);
// Start scrolling a layer
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Gesture));
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
// The fling should be ignored since there's no layer being scrolled impl-side
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
+ EXPECT_EQ(InputHandler::ScrollIgnored,
host_impl_->FlingScrollBegin());
}
@@ -558,10 +558,10 @@ TEST_F(LayerTreeHostImplTest, ShouldScrollOnMainThread) {
root->SetShouldScrollOnMainThread(true);
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Gesture));
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
}
TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) {
@@ -575,22 +575,22 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionBasic) {
InitializeRendererAndDrawFrame();
// All scroll types inside the non-fast scrollable region should fail.
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
host_impl_->ScrollBegin(gfx::Point(25, 25),
- InputHandlerClient::Wheel));
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
+ InputHandler::Wheel));
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
host_impl_->ScrollBegin(gfx::Point(25, 25),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
// All scroll types outside this region should succeed.
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(75, 75),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(75, 75),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
}
@@ -608,16 +608,16 @@ TEST_F(LayerTreeHostImplTest, NonFastScrollableRegionWithOffset) {
// This point would fall into the non-fast scrollable region except that we've
// moved the layer down by 25 pixels.
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(40, 10),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 1));
host_impl_->ScrollEnd();
// This point is still inside the non-fast region.
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
host_impl_->ScrollBegin(gfx::Point(10, 10),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
}
TEST_F(LayerTreeHostImplTest, ScrollByReturnsCorrectValue) {
@@ -626,8 +626,8 @@ TEST_F(LayerTreeHostImplTest, ScrollByReturnsCorrectValue) {
InitializeRendererAndDrawFrame();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Gesture));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
// Trying to scroll to the left/top will not succeed.
EXPECT_FALSE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-10, 0)));
@@ -659,9 +659,9 @@ TEST_F(LayerTreeHostImplTest, ScrollVerticallyByPageReturnsCorrectValue) {
InitializeRendererAndDrawFrame();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
// Trying to scroll without a vertical scrollbar will fail.
EXPECT_FALSE(host_impl_->ScrollVerticallyByPage(
@@ -748,9 +748,9 @@ TEST_F(LayerTreeHostImplTest, ImplPinchZoom) {
host_impl_->PinchGestureEnd();
gfx::Vector2d scroll_delta(0, 10);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -858,7 +858,7 @@ TEST_F(LayerTreeHostImplTest, PinchGesture) {
scroll_layer->SetScrollOffset(gfx::Vector2d(20, 20));
float page_scale_delta = 1.f;
- host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandlerClient::Wheel);
+ host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::Wheel);
host_impl_->PinchGestureBegin();
host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(10, 10));
host_impl_->ScrollBy(gfx::Point(10, 10), gfx::Vector2d(-10, -10));
@@ -992,8 +992,8 @@ TEST_F(LayerTreeHostImplTest, CompositorFrameMetadata) {
}
// Scrolling should update metadata immediately.
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
{
CompositorFrameMetadata metadata =
@@ -1329,8 +1329,8 @@ TEST_F(LayerTreeHostImplTest, ScrollRootIgnored) {
InitializeRendererAndDrawFrame();
// Scroll event is ignored because layer is not scrollable.
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollIgnored,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
EXPECT_FALSE(did_request_redraw_);
EXPECT_FALSE(did_request_commit_);
}
@@ -1361,17 +1361,17 @@ TEST_F(LayerTreeHostImplTest, ScrollNonScrollableRootWithTopControls) {
host_impl_->active_tree()->FindRootScrollLayer();
InitializeRendererAndDrawFrame();
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Gesture));
+ EXPECT_EQ(InputHandler::ScrollIgnored,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
host_impl_->top_controls_manager()->ScrollBegin();
host_impl_->top_controls_manager()->ScrollBy(gfx::Vector2dF(0.f, 50.f));
host_impl_->top_controls_manager()->ScrollEnd();
EXPECT_EQ(host_impl_->top_controls_manager()->content_top_offset(), 0.f);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
}
TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
@@ -1404,9 +1404,9 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
host_impl_->SetViewportSize(surface_size);
InitializeRendererAndDrawFrame();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
EXPECT_TRUE(did_request_redraw_);
@@ -1423,9 +1423,9 @@ TEST_F(LayerTreeHostImplTest, ScrollChildCallsCommitAndRedraw) {
host_impl_->SetViewportSize(surface_size);
InitializeRendererAndDrawFrame();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
host_impl_->ScrollEnd();
EXPECT_TRUE(did_request_redraw_);
@@ -1442,9 +1442,9 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesChild) {
// Scroll event is ignored because the input coordinate is outside the layer
// boundaries.
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
+ EXPECT_EQ(InputHandler::ScrollIgnored,
host_impl_->ScrollBegin(gfx::Point(15, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
EXPECT_FALSE(did_request_redraw_);
EXPECT_FALSE(did_request_commit_);
}
@@ -1466,9 +1466,9 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesBackfacingChild) {
// Scroll event is ignored because the scrollable layer is not facing the
// viewer and there is nothing scrollable behind it.
- EXPECT_EQ(InputHandlerClient::ScrollIgnored,
+ EXPECT_EQ(InputHandler::ScrollIgnored,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
EXPECT_FALSE(did_request_redraw_);
EXPECT_FALSE(did_request_commit_);
}
@@ -1488,9 +1488,9 @@ TEST_F(LayerTreeHostImplTest, ScrollBlockedByContentLayer) {
// Scrolling fails because the content layer is asking to be scrolled on the
// main thread.
- EXPECT_EQ(InputHandlerClient::ScrollOnMainThread,
+ EXPECT_EQ(InputHandler::ScrollOnMainThread,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
}
TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) {
@@ -1506,9 +1506,9 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) {
gfx::Vector2d expected_scroll_delta = scroll_delta;
gfx::Vector2d expected_max_scroll =
host_impl_->active_tree()->root_layer()->max_scroll_offset();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1545,9 +1545,9 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnImplThread) {
gfx::Vector2d expected_scroll_delta = scroll_delta;
gfx::Vector2d expected_max_scroll =
host_impl_->active_tree()->root_layer()->max_scroll_offset();
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1640,9 +1640,9 @@ TEST_F(LayerTreeHostImplTest, ScrollChildAndChangePageScaleOnMainThread) {
gfx::Vector2d scroll_delta(0, 10);
gfx::Vector2d expected_scroll_delta(scroll_delta);
gfx::Vector2d expected_max_scroll(child->max_scroll_offset());
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1685,9 +1685,9 @@ TEST_F(LayerTreeHostImplTest, ScrollChildBeyondLimit) {
InitializeRendererAndDrawFrame();
{
gfx::Vector2d scroll_delta(-8, -7);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1724,9 +1724,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
InitializeRendererAndDrawFrame();
{
gfx::Vector2d scroll_delta(0, -10);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::NonBubblingGesture));
+ InputHandler::NonBubblingGesture));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1743,9 +1743,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
// The next time we scroll we should only scroll the parent.
scroll_delta = gfx::Vector2d(0, -3);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::NonBubblingGesture));
+ InputHandler::NonBubblingGesture));
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child);
@@ -1762,9 +1762,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
// After scrolling the parent, another scroll on the opposite direction
// should still scroll the child.
scroll_delta = gfx::Vector2d(0, 7);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::NonBubblingGesture));
+ InputHandler::NonBubblingGesture));
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
@@ -1784,9 +1784,9 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
host_impl_->active_tree()->SetPageScaleDelta(1.f);
scroll_delta = gfx::Vector2d(0, -2);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(1, 1),
- InputHandlerClient::NonBubblingGesture));
+ InputHandler::NonBubblingGesture));
EXPECT_EQ(grand_child, host_impl_->CurrentlyScrollingLayer());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1815,9 +1815,9 @@ TEST_F(LayerTreeHostImplTest, ScrollEventBubbling) {
InitializeRendererAndDrawFrame();
{
gfx::Vector2d scroll_delta(0, 4);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -1848,9 +1848,9 @@ TEST_F(LayerTreeHostImplTest, ScrollBeforeRedraw) {
host_impl_->active_tree()->DidBecomeActive();
// Scrolling should still work even though we did not draw yet.
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
}
TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {
@@ -1867,9 +1867,9 @@ TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {
// Scroll to the right in screen coordinates with a gesture.
gfx::Vector2d gesture_scroll_delta(10, 0);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
host_impl_->ScrollEnd();
@@ -1882,9 +1882,9 @@ TEST_F(LayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {
// Reset and scroll down with the wheel.
host_impl_->active_tree()->root_layer()->SetScrollDelta(gfx::Vector2dF());
gfx::Vector2d wheel_scroll_delta(0, 10);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandlerClient::Wheel));
+ InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), wheel_scroll_delta);
host_impl_->ScrollEnd();
@@ -1920,9 +1920,9 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
{
// Scroll down in screen coordinates with a gesture.
gfx::Vector2d gesture_scroll_delta(0, 10);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
host_impl_->ScrollEnd();
@@ -1945,9 +1945,9 @@ TEST_F(LayerTreeHostImplTest, ScrollNonAxisAlignedRotatedLayer) {
host_impl_->active_tree()->root_layer()->children()[1]->SetScrollDelta(
gfx::Vector2dF());
gfx::Vector2d gesture_scroll_delta(10, 0);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
+ EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
host_impl_->ScrollEnd();
@@ -1988,8 +1988,8 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
// Scroll down in screen coordinates with a gesture.
gfx::Vector2d scroll_delta(0, 10);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Gesture));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
host_impl_->ScrollEnd();
@@ -2003,8 +2003,8 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
// Reset and scroll down with the wheel.
host_impl_->active_tree()->root_layer()->SetScrollDelta(gfx::Vector2dF());
gfx::Vector2d wheel_scroll_delta(0, 10);
- EXPECT_EQ(InputHandlerClient::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandlerClient::Wheel));
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), wheel_scroll_delta);
host_impl_->ScrollEnd();
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 23795e4..1d74ddf 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -368,12 +368,12 @@ class LayerTreeHostScrollTestCaseWithChild
switch (impl->active_tree()->source_frame_number()) {
case 0: {
// Gesture scroll on impl thread.
- InputHandlerClient::ScrollStatus status = impl->ScrollBegin(
+ InputHandler::ScrollStatus status = impl->ScrollBegin(
gfx::ToCeiledPoint(
expected_scroll_layer_impl->position() +
gfx::Vector2dF(0.5f, 0.5f)),
- InputHandlerClient::Gesture);
- EXPECT_EQ(InputHandlerClient::ScrollStarted, status);
+ InputHandler::Gesture);
+ EXPECT_EQ(InputHandler::ScrollStarted, status);
impl->ScrollBy(gfx::Point(), scroll_amount_);
impl->ScrollEnd();
@@ -388,12 +388,12 @@ class LayerTreeHostScrollTestCaseWithChild
}
case 1: {
// Wheel scroll on impl thread.
- InputHandlerClient::ScrollStatus status = impl->ScrollBegin(
+ InputHandler::ScrollStatus status = impl->ScrollBegin(
gfx::ToCeiledPoint(
expected_scroll_layer_impl->position() +
gfx::Vector2dF(0.5f, 0.5f)),
- InputHandlerClient::Wheel);
- EXPECT_EQ(InputHandlerClient::ScrollStarted, status);
+ InputHandler::Wheel);
+ EXPECT_EQ(InputHandler::ScrollStarted, status);
impl->ScrollBy(gfx::Point(), scroll_amount_);
impl->ScrollEnd();
@@ -635,24 +635,24 @@ class LayerTreeHostScrollTestScrollZeroMaxScrollOffset
root->SetMaxScrollOffset(gfx::Vector2d(100, 100));
EXPECT_EQ(
- InputHandlerClient::ScrollStarted,
+ InputHandler::ScrollStarted,
root->TryScroll(
gfx::PointF(0.0f, 1.0f),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
root->SetMaxScrollOffset(gfx::Vector2d(0, 0));
EXPECT_EQ(
- InputHandlerClient::ScrollIgnored,
+ InputHandler::ScrollIgnored,
root->TryScroll(
gfx::PointF(0.0f, 1.0f),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
root->SetMaxScrollOffset(gfx::Vector2d(-100, -100));
EXPECT_EQ(
- InputHandlerClient::ScrollIgnored,
+ InputHandler::ScrollIgnored,
root->TryScroll(
gfx::PointF(0.0f, 1.0f),
- InputHandlerClient::Gesture));
+ InputHandler::Gesture));
EndTest();
}
@@ -663,14 +663,14 @@ class LayerTreeHostScrollTestScrollZeroMaxScrollOffset
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostScrollTestScrollZeroMaxScrollOffset);
-class ThreadCheckingInputHandler : public InputHandler {
+class ThreadCheckingInputHandlerClient : public InputHandlerClient {
public:
- ThreadCheckingInputHandler(base::SingleThreadTaskRunner* runner,
- bool* received_stop_flinging)
+ ThreadCheckingInputHandlerClient(base::SingleThreadTaskRunner* runner,
+ bool* received_stop_flinging)
: task_runner_(runner) ,
received_stop_flinging_(received_stop_flinging) {}
- virtual void BindToClient(InputHandlerClient* client) OVERRIDE {
+ virtual void BindToHandler(InputHandler* handler) OVERRIDE {
if (!task_runner_->BelongsToCurrentThread())
ADD_FAILURE() << "BindToClient called on wrong thread";
}
@@ -700,8 +700,8 @@ class ThreadCheckingFakeLayerTreeHostClient : public FakeLayerTreeHostClient {
task_runner_(task_runner),
received_stop_flinging_(received_stop_flinging) {}
- virtual scoped_ptr<InputHandler> CreateInputHandler() OVERRIDE {
- return scoped_ptr<InputHandler>(new ThreadCheckingInputHandler(
+ virtual scoped_ptr<InputHandlerClient> CreateInputHandlerClient() OVERRIDE {
+ return scoped_ptr<InputHandlerClient>(new ThreadCheckingInputHandlerClient(
task_runner_, received_stop_flinging_)).Pass();
}
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 3b051f7..ef8cce7 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -518,8 +518,8 @@ void ThreadProxy::MainThreadHasStoppedFlinging() {
void ThreadProxy::MainThreadHasStoppedFlingingOnImplThread() {
DCHECK(IsImplThread());
- if (input_handler_on_impl_thread_)
- input_handler_on_impl_thread_->MainThreadHasStoppedFlinging();
+ if (input_handler_client_on_impl_thread_)
+ input_handler_client_on_impl_thread_->MainThreadHasStoppedFlinging();
}
void ThreadProxy::Start() {
@@ -528,12 +528,13 @@ void ThreadProxy::Start() {
// Create LayerTreeHostImpl.
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
CompletionEvent completion;
- scoped_ptr<InputHandler> handler = layer_tree_host_->CreateInputHandler();
+ scoped_ptr<InputHandlerClient> input_handler_client =
+ layer_tree_host_->CreateInputHandlerClient();
Proxy::ImplThread()->PostTask(
base::Bind(&ThreadProxy::InitializeImplOnImplThread,
base::Unretained(this),
&completion,
- handler.release()));
+ input_handler_client.release()));
completion.Wait();
main_thread_weak_ptr_ = weak_factory_.GetWeakPtr();
@@ -885,8 +886,8 @@ ThreadProxy::ScheduledActionDrawAndSwapInternal(bool forced_draw) {
layer_tree_host_impl_->CurrentFrameTimeTicks();
base::Time wall_clock_time = layer_tree_host_impl_->CurrentFrameTime();
- if (input_handler_on_impl_thread_)
- input_handler_on_impl_thread_->Animate(monotonic_time);
+ if (input_handler_client_on_impl_thread_)
+ input_handler_client_on_impl_thread_->Animate(monotonic_time);
layer_tree_host_impl_->ActivatePendingTreeIfNeeded();
layer_tree_host_impl_->Animate(monotonic_time, wall_clock_time);
@@ -1079,8 +1080,9 @@ void ThreadProxy::TryToRecreateOutputSurface() {
output_surface_recreation_callback_.Cancel();
}
-void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion,
- InputHandler* handler) {
+void ThreadProxy::InitializeImplOnImplThread(
+ CompletionEvent* completion,
+ InputHandlerClient* input_handler_client) {
TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread");
DCHECK(IsImplThread());
layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this);
@@ -1111,9 +1113,11 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion,
scheduler_settings);
scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible());
- input_handler_on_impl_thread_ = scoped_ptr<InputHandler>(handler);
- if (input_handler_on_impl_thread_)
- input_handler_on_impl_thread_->BindToClient(layer_tree_host_impl_.get());
+ input_handler_client_on_impl_thread_.reset(input_handler_client);
+ if (input_handler_client_on_impl_thread_) {
+ input_handler_client_on_impl_thread_->BindToHandler(
+ layer_tree_host_impl_.get());
+ }
impl_thread_weak_ptr_ = weak_factory_on_impl_thread_.GetWeakPtr();
completion->Signal();
@@ -1159,7 +1163,7 @@ void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) {
layer_tree_host_->DeleteContentsTexturesOnImplThread(
layer_tree_host_impl_->resource_provider());
layer_tree_host_impl_->EnableVSyncNotification(false);
- input_handler_on_impl_thread_.reset();
+ input_handler_client_on_impl_thread_.reset();
layer_tree_host_impl_.reset();
scheduler_on_impl_thread_.reset();
weak_factory_on_impl_thread_.InvalidateWeakPtrs();
diff --git a/cc/trees/thread_proxy.h b/cc/trees/thread_proxy.h
index 58fb05f..0bc1cf1 100644
--- a/cc/trees/thread_proxy.h
+++ b/cc/trees/thread_proxy.h
@@ -19,7 +19,7 @@
namespace cc {
class ContextProvider;
-class InputHandler;
+class InputHandlerClient;
class LayerTreeHost;
class ResourceUpdateQueue;
class Scheduler;
@@ -154,7 +154,7 @@ class ThreadProxy : public Proxy,
void RequestReadbackOnImplThread(ReadbackRequest* request);
void FinishAllRenderingOnImplThread(CompletionEvent* completion);
void InitializeImplOnImplThread(CompletionEvent* completion,
- InputHandler* input_handler);
+ InputHandlerClient* input_handler_client);
void SetSurfaceReadyOnImplThread();
void SetVisibleOnImplThread(CompletionEvent* completion, bool visible);
void InitializeOutputSurfaceOnImplThread(
@@ -215,7 +215,7 @@ class ThreadProxy : public Proxy,
scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_;
- scoped_ptr<InputHandler> input_handler_on_impl_thread_;
+ scoped_ptr<InputHandlerClient> input_handler_client_on_impl_thread_;
scoped_ptr<Scheduler> scheduler_on_impl_thread_;