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

Unified Diff: extensions/shell/browser/input_method_event_handler.h

Issue 2909603002: Revert of Remove InputMethodEventHandler. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « extensions/shell/BUILD.gn ('k') | extensions/shell/browser/input_method_event_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/browser/input_method_event_handler.h
diff --git a/extensions/shell/browser/input_method_event_handler.h b/extensions/shell/browser/input_method_event_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..b322cc160dbfa35191d42b068779962e800c5ca7
--- /dev/null
+++ b/extensions/shell/browser/input_method_event_handler.h
@@ -0,0 +1,42 @@
+// Copyright 2016 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 EXTENSIONS_SHELL_BROWSER_INPUT_METHOD_EVENT_HANDLER_H_
+#define EXTENSIONS_SHELL_BROWSER_INPUT_METHOD_EVENT_HANDLER_H_
+
+#include "base/macros.h"
+#include "ui/events/event_handler.h"
+
+namespace ui {
+class InputMethod;
+class KeyEvent;
+}
+
+namespace extensions {
+
+// Basic EventHandler for dispatching key events.
+class InputMethodEventHandler : public ui::EventHandler {
+ public:
+ explicit InputMethodEventHandler(ui::InputMethod* input_method);
+ ~InputMethodEventHandler() override;
+
+ void set_post_ime(bool post_ime);
+
+ private:
+ // ui::EventHandler:
+ void OnKeyEvent(ui::KeyEvent* event) override;
+
+ // The input method to pass events. Should outlive this handler.
+ ui::InputMethod* input_method_;
+
+ // True when an event is dispatched within DispatchKeyEventPostIME(), meaning
+ // it has already been processed by the input method.
+ bool post_ime_;
+
+ DISALLOW_COPY_AND_ASSIGN(InputMethodEventHandler);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_SHELL_BROWSER_INPUT_METHOD_EVENT_HANDLER_H_
« no previous file with comments | « extensions/shell/BUILD.gn ('k') | extensions/shell/browser/input_method_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698