| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_H_ | 5 #ifndef UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ |
| 6 #define UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ | 6 #define UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void CancelComposition(const TextInputClient* client) override; | 42 void CancelComposition(const TextInputClient* client) override; |
| 43 bool IsCandidatePopupOpen() const override; | 43 bool IsCandidatePopupOpen() const override; |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 // Converts |text| into CompositionText. | 46 // Converts |text| into CompositionText. |
| 47 void ExtractCompositionText(const CompositionText& text, | 47 void ExtractCompositionText(const CompositionText& text, |
| 48 uint32_t cursor_position, | 48 uint32_t cursor_position, |
| 49 CompositionText* out_composition) const; | 49 CompositionText* out_composition) const; |
| 50 | 50 |
| 51 // Process a key returned from the input method. | 51 // Process a key returned from the input method. |
| 52 virtual ui::EventDispatchDetails ProcessKeyEventPostIME(ui::KeyEvent* event, | 52 virtual ui::EventDispatchDetails ProcessKeyEventPostIME( |
| 53 bool handled) | 53 ui::KeyEvent* event, |
| 54 WARN_UNUSED_RESULT; | 54 std::unique_ptr<AckCallback> ack_callback, |
| 55 bool skip_process_filtered, |
| 56 bool handled) WARN_UNUSED_RESULT; |
| 55 | 57 |
| 56 // Resets context and abandon all pending results and key events. | 58 // Resets context and abandon all pending results and key events. |
| 57 void ResetContext(); | 59 void ResetContext(); |
| 58 | 60 |
| 61 ui::EventDispatchDetails DispatchKeyEventPostIME( |
| 62 ui::KeyEvent* event, |
| 63 std::unique_ptr<AckCallback> ack_callback) const WARN_UNUSED_RESULT; |
| 64 |
| 59 private: | 65 private: |
| 60 class PendingKeyEvent; | 66 class PendingKeyEvent; |
| 61 | 67 |
| 62 // Overridden from InputMethodBase: | 68 // Overridden from InputMethodBase: |
| 63 void OnWillChangeFocusedClient(TextInputClient* focused_before, | 69 void OnWillChangeFocusedClient(TextInputClient* focused_before, |
| 64 TextInputClient* focused) override; | 70 TextInputClient* focused) override; |
| 65 void OnDidChangeFocusedClient(TextInputClient* focused_before, | 71 void OnDidChangeFocusedClient(TextInputClient* focused_before, |
| 66 TextInputClient* focused) override; | 72 TextInputClient* focused) override; |
| 67 | 73 |
| 68 // Asks the client to confirm current composition text. | 74 // Asks the client to confirm current composition text. |
| 69 void ConfirmCompositionText(); | 75 void ConfirmCompositionText(); |
| 70 | 76 |
| 71 // Checks the availability of focused text input client and update focus | 77 // Checks the availability of focused text input client and update focus |
| 72 // state. | 78 // state. |
| 73 void UpdateContextFocusState(); | 79 void UpdateContextFocusState(); |
| 74 | 80 |
| 75 // Processes a key event that was already filtered by the input method. | 81 // Processes a key event that was already filtered by the input method. |
| 76 // A VKEY_PROCESSKEY may be dispatched to the EventTargets. | 82 // A VKEY_PROCESSKEY may be dispatched to the EventTargets. |
| 77 // It returns the result of whether the event has been stopped propagation | 83 // It returns the result of whether the event has been stopped propagation |
| 78 // when dispatching post IME. | 84 // when dispatching post IME. |
| 79 ui::EventDispatchDetails ProcessFilteredKeyPressEvent(ui::KeyEvent* event) | 85 ui::EventDispatchDetails ProcessFilteredKeyPressEvent( |
| 80 WARN_UNUSED_RESULT; | 86 ui::KeyEvent* event, |
| 87 std::unique_ptr<AckCallback> ack_callback) WARN_UNUSED_RESULT; |
| 88 |
| 89 void PostProcessFilteredKeyPressEvent( |
| 90 ui::KeyEvent* event, |
| 91 TextInputClient* prev_client, |
| 92 std::unique_ptr<AckCallback> ack_callback, |
| 93 bool stopped_propagation); |
| 81 | 94 |
| 82 // Processes a key event that was not filtered by the input method. | 95 // Processes a key event that was not filtered by the input method. |
| 83 ui::EventDispatchDetails ProcessUnfilteredKeyPressEvent(ui::KeyEvent* event) | 96 ui::EventDispatchDetails ProcessUnfilteredKeyPressEvent( |
| 84 WARN_UNUSED_RESULT; | 97 ui::KeyEvent* event, |
| 98 std::unique_ptr<AckCallback> ack_callback) WARN_UNUSED_RESULT; |
| 99 |
| 100 void PostProcessUnfilteredKeyPressEvent( |
| 101 ui::KeyEvent* event, |
| 102 TextInputClient* prev_client, |
| 103 std::unique_ptr<AckCallback> ack_callback, |
| 104 bool stopped_propagation); |
| 85 | 105 |
| 86 // Sends input method result caused by the given key event to the focused text | 106 // Sends input method result caused by the given key event to the focused text |
| 87 // input client. | 107 // input client. |
| 88 void ProcessInputMethodResult(ui::KeyEvent* event, bool filtered); | 108 void ProcessInputMethodResult(ui::KeyEvent* event, bool filtered); |
| 89 | 109 |
| 90 // Checks if the pending input method result needs inserting into the focused | 110 // Checks if the pending input method result needs inserting into the focused |
| 91 // text input client as a single character. | 111 // text input client as a single character. |
| 92 bool NeedInsertChar() const; | 112 bool NeedInsertChar() const; |
| 93 | 113 |
| 94 // Checks if there is pending input method result. | 114 // Checks if there is pending input method result. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 172 |
| 153 // Used for making callbacks. | 173 // Used for making callbacks. |
| 154 base::WeakPtrFactory<InputMethodChromeOS> weak_ptr_factory_; | 174 base::WeakPtrFactory<InputMethodChromeOS> weak_ptr_factory_; |
| 155 | 175 |
| 156 DISALLOW_COPY_AND_ASSIGN(InputMethodChromeOS); | 176 DISALLOW_COPY_AND_ASSIGN(InputMethodChromeOS); |
| 157 }; | 177 }; |
| 158 | 178 |
| 159 } // namespace ui | 179 } // namespace ui |
| 160 | 180 |
| 161 #endif // UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ | 181 #endif // UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ |
| OLD | NEW |