Chromium Code Reviews| 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..45a4443641670598d5a9ae4b0252e3645306337c |
| --- /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; |
| + |
| + // True when an event is dispatched within DispatchKeyEventPostIME(), meaning |
|
Rahul Chaturvedi
2016/12/15 22:42:46
nit: This comment should be on the field declarati
michaelpg
2016/12/15 23:55:52
Done.
|
| + // it has already been processed by the input method. |
| + void SetPostIME(bool post_ime); |
|
Rahul Chaturvedi
2016/12/15 22:42:46
nit: Since this is a setter, set_post_ime(bool pos
michaelpg
2016/12/15 23:55:52
Done.
|
| + |
| + private: |
| + // ui::EventHandler: |
| + void OnKeyEvent(ui::KeyEvent* event) override; |
| + |
| + // The input method to pass events. Should outlive this handler. |
| + ui::InputMethod* input_method_; |
| + |
| + bool post_ime_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(InputMethodEventHandler); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_SHELL_BROWSER_METHOD_EVENT_HANDLER_H_ |