| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "ui/base/ime/composition_text.h" | 11 #include "ui/base/ime/composition_text.h" |
| 11 #include "ui/base/ime/input_method_base.h" | 12 #include "ui/base/ime/input_method_base.h" |
| 12 #include "ui/base/ime/linux/linux_input_method_context.h" | 13 #include "ui/base/ime/linux/linux_input_method_context.h" |
| 13 | 14 |
| 14 namespace ui { | 15 namespace ui { |
| 15 | 16 |
| 16 // A ui::InputMethod implementation for Aura on Linux platforms. The | 17 // A ui::InputMethod implementation for Aura on Linux platforms. The |
| 17 // implementation details are separated to ui::LinuxInputMethodContext | 18 // implementation details are separated to ui::LinuxInputMethodContext |
| 18 // interface. | 19 // interface. |
| 19 class UI_BASE_IME_EXPORT InputMethodAuraLinux | 20 class UI_BASE_IME_EXPORT InputMethodAuraLinux |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // call ProcessKeyEventDone() for the following processing. This is necessary | 67 // call ProcessKeyEventDone() for the following processing. This is necessary |
| 67 // as this method is async. The environment may be changed by other generated | 68 // as this method is async. The environment may be changed by other generated |
| 68 // key events by the time the callback is run. | 69 // key events by the time the callback is run. |
| 69 void ProcessKeyEventByEngineDone(ui::KeyEvent* event, | 70 void ProcessKeyEventByEngineDone(ui::KeyEvent* event, |
| 70 bool filtered, | 71 bool filtered, |
| 71 bool composition_changed, | 72 bool composition_changed, |
| 72 ui::CompositionText* composition, | 73 ui::CompositionText* composition, |
| 73 base::string16* result_text, | 74 base::string16* result_text, |
| 74 bool is_handled); | 75 bool is_handled); |
| 75 | 76 |
| 76 scoped_ptr<LinuxInputMethodContext> context_; | 77 std::unique_ptr<LinuxInputMethodContext> context_; |
| 77 scoped_ptr<LinuxInputMethodContext> context_simple_; | 78 std::unique_ptr<LinuxInputMethodContext> context_simple_; |
| 78 | 79 |
| 79 base::string16 result_text_; | 80 base::string16 result_text_; |
| 80 | 81 |
| 81 ui::CompositionText composition_; | 82 ui::CompositionText composition_; |
| 82 | 83 |
| 83 // The current text input type used to indicates if |context_| and | 84 // The current text input type used to indicates if |context_| and |
| 84 // |context_simple_| are focused or not. | 85 // |context_simple_| are focused or not. |
| 85 TextInputType text_input_type_; | 86 TextInputType text_input_type_; |
| 86 | 87 |
| 87 // Indicates if currently in sync mode when handling a key event. | 88 // Indicates if currently in sync mode when handling a key event. |
| 88 // This is used in OnXXX callbacks from GTK IM module. | 89 // This is used in OnXXX callbacks from GTK IM module. |
| 89 bool is_sync_mode_; | 90 bool is_sync_mode_; |
| 90 | 91 |
| 91 // Indicates if the composition text is changed or deleted. | 92 // Indicates if the composition text is changed or deleted. |
| 92 bool composition_changed_; | 93 bool composition_changed_; |
| 93 | 94 |
| 94 // If it's true then all input method result received before the next key | 95 // If it's true then all input method result received before the next key |
| 95 // event will be discarded. | 96 // event will be discarded. |
| 96 bool suppress_next_result_; | 97 bool suppress_next_result_; |
| 97 | 98 |
| 98 // Used for making callbacks. | 99 // Used for making callbacks. |
| 99 base::WeakPtrFactory<InputMethodAuraLinux> weak_ptr_factory_; | 100 base::WeakPtrFactory<InputMethodAuraLinux> weak_ptr_factory_; |
| 100 | 101 |
| 101 DISALLOW_COPY_AND_ASSIGN(InputMethodAuraLinux); | 102 DISALLOW_COPY_AND_ASSIGN(InputMethodAuraLinux); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace ui | 105 } // namespace ui |
| 105 | 106 |
| 106 #endif // UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ | 107 #endif // UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ |
| OLD | NEW |