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

Unified Diff: content/browser/android/in_process/synchronous_input_event_filter.h

Issue 15920002: Fix WebView compositor input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/in_process/synchronous_input_event_filter.h
diff --git a/content/browser/android/in_process/synchronous_input_event_filter.h b/content/browser/android/in_process/synchronous_input_event_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..8244f1e54526963c643b8e1671dd3311a5ad658a
--- /dev/null
+++ b/content/browser/android/in_process/synchronous_input_event_filter.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
joth 2013/05/31 20:57:47 2013 (cl upload doesn't warn? shrug)
jdduke (slow) 2013/06/04 15:46:23 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_ANDOIRD_IN_PROCESS_SYNCHRONOUS_INPUT_EVENT_FILTER_H_
+#define CONTENT_BROWSER_ANDROID_IN_PROCESS_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 provided |handler| process WebInputEvents synchronously on the merged
+// UI and compositing thread. If the event goes unhandled, that is reflected in
+// the InputEventAckState; no forwarding is performed.
+class SynchronousInputEventFilter : public InputHandlerManagerClient {
+ public:
+ SynchronousInputEventFilter();
+ virtual ~SynchronousInputEventFilter();
+
+ InputEventAckState HandleInputEvent(int routing_id,
+ const WebKit::WebInputEvent* input_event);
+
+ // InputHandlerManagerClient implementation.
+ virtual void SetHandler(const Handler& handler) OVERRIDE;
+ 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:
+ void SetHandlerOnUIThread(const Handler& handler);
+
+ Handler handler_;
+
+ // A pointer to the intermediate result returned by HandleInputEvent, valid
+ // ONLY within the scope of HandleInputEvent. Calls to
+ // Did/DidNotHandleInputEvent will modify the referenced result.
+ InputEventAckState* handle_input_event_result_;
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_INPUT_EVENT_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698