summaryrefslogtreecommitdiffstats
path: root/cc/input_handler.h
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-12 22:43:41 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-12 22:43:41 +0000
commitcd57cc5a246367c2558fefa04ae9eca8f4d545d2 (patch)
treea2235045e9c5e4ff028d641b76f5d01aa5461b26 /cc/input_handler.h
parent3fe7ba055be580443445895c0ee01ada3b628487 (diff)
downloadchromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.zip
chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.tar.gz
chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.tar.bz2
[cc] Rename all cc/ filenames to Chromium style
BUG=155413 Review URL: https://codereview.chromium.org/11122003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/input_handler.h')
-rw-r--r--cc/input_handler.h82
1 files changed, 81 insertions, 1 deletions
diff --git a/cc/input_handler.h b/cc/input_handler.h
index 638cbb2..7188cab 100644
--- a/cc/input_handler.h
+++ b/cc/input_handler.h
@@ -1,3 +1,83 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
+// Copyright 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
+#ifndef CCInputHandler_h
+#define CCInputHandler_h
+
+#include "base/basictypes.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace cc {
+
+class IntPoint;
+class IntSize;
+
+// The CCInputHandler is a way for the embedders to interact with
+// the impl thread side of the compositor implementation.
+//
+// There is one CCInputHandler for every CCLayerTreeHost. It is
+// created on the main thread and used only on the impl thread.
+//
+// The CCInputHandler is constructed with a CCInputHandlerClient, which is the
+// interface by which the handler can manipulate the LayerTree.
+class CCInputHandlerClient {
+public:
+ enum ScrollStatus { ScrollOnMainThread, ScrollStarted, ScrollIgnored };
+ enum ScrollInputType { Gesture, Wheel };
+
+ // Selects a layer to be scrolled at a given point in window coordinates.
+ // Returns ScrollStarted if the layer at the coordinates can be scrolled,
+ // ScrollOnMainThread if the scroll event should instead be delegated to the
+ // main thread, or ScrollIgnored if there is nothing to be scrolled at the
+ // given coordinates.
+ virtual ScrollStatus scrollBegin(const IntPoint&, ScrollInputType) = 0;
+
+ // Scroll the selected layer starting at the given window coordinate. If
+ // there is no room to move the layer in the requested direction, its first
+ // ancestor layer that can be scrolled will be moved instead. Should only be
+ // called if scrollBegin() returned ScrollStarted.
+ virtual void scrollBy(const IntPoint&, const IntSize&) = 0;
+
+ // Stop scrolling the selected layer. Should only be called if scrollBegin()
+ // returned ScrollStarted.
+ virtual void scrollEnd() = 0;
+
+ virtual void pinchGestureBegin() = 0;
+ virtual void pinchGestureUpdate(float magnifyDelta, const IntPoint& anchor) = 0;
+ virtual void pinchGestureEnd() = 0;
+
+ virtual void startPageScaleAnimation(const IntSize& targetPosition,
+ bool anchorPoint,
+ float pageScale,
+ double startTime,
+ double duration) = 0;
+
+ // Request another callback to CCInputHandler::animate().
+ virtual void scheduleAnimation() = 0;
+
+protected:
+ CCInputHandlerClient() { }
+ virtual ~CCInputHandlerClient() { }
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(CCInputHandlerClient);
+};
+
+class CCInputHandler {
+public:
+ virtual ~CCInputHandler() { }
+
+ virtual void bindToClient(CCInputHandlerClient*) = 0;
+ virtual void animate(double monotonicTime) = 0;
+
+protected:
+ CCInputHandler() { }
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(CCInputHandler);
+};
+
+}
+
+#endif