Index: content/renderer/gpu/input_handler_manager_client.h |
diff --git a/content/renderer/gpu/input_handler_manager_client.h b/content/renderer/gpu/input_handler_manager_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ef218bd42313daad166b656fda40abce032cc578 |
--- /dev/null |
+++ b/content/renderer/gpu/input_handler_manager_client.h |
@@ -0,0 +1,48 @@ |
+// Copyright (c) 2012 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 CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |
+#define CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/callback_forward.h" |
+ |
+namespace WebKit { |
+class WebInputEvent; |
+} |
+ |
+namespace content { |
+ |
+class InputHandlerManagerClient { |
+ public: |
+ virtual ~InputHandlerManagerClient() {} |
+ |
+ // The Handler allows the client to forward input events in such a way that |
+ // callbacks to DidHandleInputEvent or DidNotHandlerInputEvent are made with |
+ // the appropriate response. |
+ // The Manager guarantees that the supplied |handler| is valid, but only until |
+ // the next call to DidBind. The client should only makes calls to |handler| |
joth
2013/05/31 18:05:08
ah! DidBind() will be called multiple times, and w
jdduke (slow)
2013/05/31 20:48:24
Yeah, I'm open to changing this. I had it as SetH
|
+ // on the compositing thread. |
+ typedef base::Callback<void(int /*routing_id*/, |
+ const WebKit::WebInputEvent*)> Handler; |
+ |
+ // Called from the main thread. |
+ virtual void DidBind(const Handler& handler) = 0; |
+ virtual void DidAddInputHandler(int routing_id) = 0; |
joth
2013/05/31 18:05:08
It's be useful to repeat the contract on when and
jdduke (slow)
2013/05/31 20:48:24
Yeah. I really think these two callback methods s
|
+ virtual void DidRemoveInputHandler(int routing_id) = 0; |
+ |
+ // Called from the compositing thread. |
+ virtual void DidHandleInputEvent() = 0; |
+ virtual void DidNotHandleInputEvent(bool send_to_widget) = 0; |
+ |
+ protected: |
+ InputHandlerManagerClient() {} |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |