| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ | 5 #ifndef CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ |
| 6 #define CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ | 6 #define CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // Called when a key event is handled. | 170 // Called when a key event is handled. |
| 171 void KeyEventHandled(const std::string& extension_id, | 171 void KeyEventHandled(const std::string& extension_id, |
| 172 const std::string& request_id, | 172 const std::string& request_id, |
| 173 bool handled); | 173 bool handled); |
| 174 | 174 |
| 175 // Adds unprocessed key event to |request_map_|. | 175 // Adds unprocessed key event to |request_map_|. |
| 176 std::string AddRequest( | 176 std::string AddRequest( |
| 177 const std::string& component_id, | 177 const std::string& component_id, |
| 178 ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data); | 178 ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data); |
| 179 | 179 |
| 180 // Called when a key event is handled. | |
| 181 void KeyEventHandled(); | |
| 182 | |
| 183 protected: | 180 protected: |
| 184 // Notifies InputContextHandler that the composition is changed. | 181 // Notifies InputContextHandler that the composition is changed. |
| 185 virtual void UpdateComposition(const ui::CompositionText& composition_text, | 182 virtual void UpdateComposition(const ui::CompositionText& composition_text, |
| 186 uint32_t cursor_pos, | 183 uint32_t cursor_pos, |
| 187 bool is_visible) = 0; | 184 bool is_visible) = 0; |
| 188 // Notifies InputContextHanlder to commit |text|. | 185 // Notifies InputContextHanlder to commit |text|. |
| 189 virtual void CommitTextToInputContext(int context_id, | 186 virtual void CommitTextToInputContext(int context_id, |
| 190 const std::string& text) = 0; | 187 const std::string& text) = 0; |
| 191 // Sends the key event to the window tree host. | 188 // Sends the key event to the window tree host. |
| 192 virtual bool SendKeyEvent(ui::KeyEvent* ui_event, | 189 virtual bool SendKeyEvent(ui::KeyEvent* ui_event, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 222 using RequestMap = | 219 using RequestMap = |
| 223 std::map<std::string, | 220 std::map<std::string, |
| 224 std::pair<std::string, | 221 std::pair<std::string, |
| 225 ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>; | 222 ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>; |
| 226 | 223 |
| 227 unsigned int next_request_id_; | 224 unsigned int next_request_id_; |
| 228 RequestMap request_map_; | 225 RequestMap request_map_; |
| 229 | 226 |
| 230 // The composition text to be set from calling input.ime.setComposition API. | 227 // The composition text to be set from calling input.ime.setComposition API. |
| 231 ui::CompositionText composition_; | 228 ui::CompositionText composition_; |
| 229 bool composition_changed_; |
| 232 | 230 |
| 233 // The text to be committed from calling input.ime.commitText API. | 231 // The text to be committed from calling input.ime.commitText API. |
| 234 std::string text_; | 232 std::string text_; |
| 233 bool commit_text_changed_; |
| 235 | 234 |
| 236 // Indicates whether the IME extension is currently handling a physical key | 235 // Indicates whether the IME extension is currently handling a physical key |
| 237 // event. This is used in CommitText/UpdateCompositionText/etc. | 236 // event. This is used in CommitText/UpdateCompositionText/etc. |
| 238 bool handling_key_event_; | 237 bool handling_key_event_; |
| 239 }; | 238 }; |
| 240 | 239 |
| 241 } // namespace input_method | 240 } // namespace input_method |
| 242 | 241 |
| 243 #endif // CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ | 242 #endif // CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ |
| OLD | NEW |