OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ | 5 #ifndef UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ |
6 #define UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ | 6 #define UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/base/ime/composition_text.h" | 10 #include "ui/base/ime/composition_text.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 TextInputClient* focused) override; | 50 TextInputClient* focused) override; |
51 | 51 |
52 private: | 52 private: |
53 bool HasInputMethodResult(); | 53 bool HasInputMethodResult(); |
54 bool NeedInsertChar() const; | 54 bool NeedInsertChar() const; |
55 ui::EventDispatchDetails SendFakeProcessKeyEvent(ui::KeyEvent* event) const; | 55 ui::EventDispatchDetails SendFakeProcessKeyEvent(ui::KeyEvent* event) const; |
56 void ConfirmCompositionText(); | 56 void ConfirmCompositionText(); |
57 void UpdateContextFocusState(); | 57 void UpdateContextFocusState(); |
58 void ResetContext(); | 58 void ResetContext(); |
59 | 59 |
60 // Callback function for IMEEngineHandlerInterface::ProcessKeyEvent. | 60 // Processes the key event after the event is processed by the system IME or |
| 61 // the extension. |
61 void ProcessKeyEventDone(ui::KeyEvent* event, bool filtered, bool is_handled); | 62 void ProcessKeyEventDone(ui::KeyEvent* event, bool filtered, bool is_handled); |
62 | 63 |
| 64 // Callback function for IMEEngineHandlerInterface::ProcessKeyEvent(). |
| 65 // It recovers the context when the event is being passed to the extension and |
| 66 // call ProcessKeyEventDone() for the following processing. This is necessary |
| 67 // as this method is async. The environment may be changed by other generated |
| 68 // key events by the time the callback is run. |
| 69 void ProcessKeyEventByEngineDone(ui::KeyEvent* event, |
| 70 bool filtered, |
| 71 bool composition_changed, |
| 72 ui::CompositionText* composition, |
| 73 base::string16* result_text, |
| 74 bool is_handled); |
| 75 |
63 scoped_ptr<LinuxInputMethodContext> context_; | 76 scoped_ptr<LinuxInputMethodContext> context_; |
64 scoped_ptr<LinuxInputMethodContext> context_simple_; | 77 scoped_ptr<LinuxInputMethodContext> context_simple_; |
65 | 78 |
66 base::string16 result_text_; | 79 base::string16 result_text_; |
67 | 80 |
68 ui::CompositionText composition_; | 81 ui::CompositionText composition_; |
69 | 82 |
70 // The current text input type used to indicates if |context_| and | 83 // The current text input type used to indicates if |context_| and |
71 // |context_simple_| are focused or not. | 84 // |context_simple_| are focused or not. |
72 TextInputType text_input_type_; | 85 TextInputType text_input_type_; |
(...skipping 11 matching lines...) Expand all Loading... |
84 | 97 |
85 // Used for making callbacks. | 98 // Used for making callbacks. |
86 base::WeakPtrFactory<InputMethodAuraLinux> weak_ptr_factory_; | 99 base::WeakPtrFactory<InputMethodAuraLinux> weak_ptr_factory_; |
87 | 100 |
88 DISALLOW_COPY_AND_ASSIGN(InputMethodAuraLinux); | 101 DISALLOW_COPY_AND_ASSIGN(InputMethodAuraLinux); |
89 }; | 102 }; |
90 | 103 |
91 } // namespace ui | 104 } // namespace ui |
92 | 105 |
93 #endif // UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ | 106 #endif // UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ |
OLD | NEW |