Index: content/renderer/android/synchronous_input_event_filter.h |
diff --git a/content/renderer/android/synchronous_input_event_filter.h b/content/renderer/android/synchronous_input_event_filter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6a723a802a4a8b0228524d3c702a4c6411568bad |
--- /dev/null |
+++ b/content/renderer/android/synchronous_input_event_filter.h |
@@ -0,0 +1,54 @@ |
+// Copyright (c) 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 CONTENT_RENDERER_ANDROID_SYNCHRONOUS_INPUT_EVENT_FILTER_H_ |
+#define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_INPUT_EVENT_FILTER_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/callback.h" |
+#include "base/compiler_specific.h" |
+#include "content/port/common/input_event_ack_state.h" |
+#include "content/renderer/gpu/input_handler_manager_client.h" |
+ |
+namespace WebKit { |
+class WebInputEvent; |
+} |
+ |
+namespace content { |
+ |
+// This class perform synchronous, in-process InputEvent handling. |
+// |
+// The user of this class provides an instance of InputEventFilter::Handler, |
+// which will be passed WebInputEvents on the compositing thread. If the event |
+// goes unhandled, that is reflected in the InputEventAckState; no forwarding |
+// is performed. |
+// |
+// It is up to the user to ensure thread-safety. |
joth
2013/05/31 18:05:08
user means caller, or sub-classer?
jdduke (slow)
2013/05/31 20:48:24
Caller. I'll make that clear.
|
+class SynchronousInputEventFilter : public InputHandlerManagerClient { |
joth
2013/05/31 18:05:08
feels like this whole class could now live in cont
jdduke (slow)
2013/05/31 20:48:24
Hmm, I put it here because it has a content/render
|
+ public: |
+ SynchronousInputEventFilter(); |
+ virtual ~SynchronousInputEventFilter(); |
+ |
+ InputEventAckState HandleInputEvent(int routing_id, |
+ const WebKit::WebInputEvent* input_event); |
+ |
+ // InputHandlerManagerClient implementation. |
+ virtual void DidBind(const Handler& handler); |
+ virtual void DidAddInputHandler(int routing_id) OVERRIDE {} |
+ virtual void DidRemoveInputHandler(int routing_id) OVERRIDE {} |
+ virtual void DidHandleInputEvent() OVERRIDE; |
+ virtual void DidNotHandleInputEvent(bool send_to_widget) OVERRIDE; |
+ |
+ private: |
+ Handler handler_; |
+ |
+ // A temporary result reflecting the intermediate callback sequence of |
+ // Did/DidNotHandleInputEvent, initiated by a call to HandleInputEvent. This |
+ // does not affect external state. |
+ InputEventAckState event_result_; |
joth
2013/05/31 18:05:08
To make this super-clear, you _could_ turn this in
jdduke (slow)
2013/05/31 20:48:24
Done.
|
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_INPUT_EVENT_FILTER_H_ |