| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Returns whether the observer is interested in key events. | 97 // Returns whether the observer is interested in key events. |
| 98 virtual bool IsInterestedInKeyEvent() const = 0; | 98 virtual bool IsInterestedInKeyEvent() const = 0; |
| 99 | 99 |
| 100 // Called when a surrounding text is changed. | 100 // Called when a surrounding text is changed. |
| 101 virtual void OnSurroundingTextChanged(const std::string& engine_id, | 101 virtual void OnSurroundingTextChanged(const std::string& engine_id, |
| 102 const std::string& text, | 102 const std::string& text, |
| 103 int cursor_pos, | 103 int cursor_pos, |
| 104 int anchor_pos, | 104 int anchor_pos, |
| 105 int offset_pos) = 0; | 105 int offset_pos) = 0; |
| 106 | 106 |
| 107 // Called when the engine's MaybeSwitchEngine is called. |
| 108 virtual void OnRequestEngineSwitch() = 0; |
| 109 |
| 107 #if defined(OS_CHROMEOS) | 110 #if defined(OS_CHROMEOS) |
| 108 | 111 |
| 109 // Called when an InputContext's properties change while it is focused. | 112 // Called when an InputContext's properties change while it is focused. |
| 110 virtual void OnInputContextUpdate( | 113 virtual void OnInputContextUpdate( |
| 111 const IMEEngineHandlerInterface::InputContext& context) = 0; | 114 const IMEEngineHandlerInterface::InputContext& context) = 0; |
| 112 | 115 |
| 113 // Called when the user clicks on an item in the candidate list. | 116 // Called when the user clicks on an item in the candidate list. |
| 114 virtual void OnCandidateClicked( | 117 virtual void OnCandidateClicked( |
| 115 const std::string& component_id, | 118 const std::string& component_id, |
| 116 int candidate_id, | 119 int candidate_id, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 130 const char* extension_id, | 133 const char* extension_id, |
| 131 Profile* profile); | 134 Profile* profile); |
| 132 | 135 |
| 133 // IMEEngineHandlerInterface overrides. | 136 // IMEEngineHandlerInterface overrides. |
| 134 void FocusIn(const ui::IMEEngineHandlerInterface::InputContext& input_context) | 137 void FocusIn(const ui::IMEEngineHandlerInterface::InputContext& input_context) |
| 135 override; | 138 override; |
| 136 void FocusOut() override; | 139 void FocusOut() override; |
| 137 void Enable(const std::string& component_id) override; | 140 void Enable(const std::string& component_id) override; |
| 138 void Disable() override; | 141 void Disable() override; |
| 139 void Reset() override; | 142 void Reset() override; |
| 143 void MaybeSwitchEngine() override; |
| 140 void ProcessKeyEvent(const ui::KeyEvent& key_event, | 144 void ProcessKeyEvent(const ui::KeyEvent& key_event, |
| 141 KeyEventDoneCallback& callback) override; | 145 KeyEventDoneCallback& callback) override; |
| 142 void SetSurroundingText(const std::string& text, | 146 void SetSurroundingText(const std::string& text, |
| 143 uint32_t cursor_pos, | 147 uint32_t cursor_pos, |
| 144 uint32_t anchor_pos, | 148 uint32_t anchor_pos, |
| 145 uint32_t offset_pos) override; | 149 uint32_t offset_pos) override; |
| 146 void SetCompositionBounds(const std::vector<gfx::Rect>& bounds) override; | 150 void SetCompositionBounds(const std::vector<gfx::Rect>& bounds) override; |
| 147 bool ClearComposition(int context_id, std::string* error) override; | 151 bool ClearComposition(int context_id, std::string* error) override; |
| 148 bool CommitText(int context_id, | 152 bool CommitText(int context_id, |
| 149 const char* text, | 153 const char* text, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 bool commit_text_changed_; | 237 bool commit_text_changed_; |
| 234 | 238 |
| 235 // Indicates whether the IME extension is currently handling a physical key | 239 // Indicates whether the IME extension is currently handling a physical key |
| 236 // event. This is used in CommitText/UpdateCompositionText/etc. | 240 // event. This is used in CommitText/UpdateCompositionText/etc. |
| 237 bool handling_key_event_; | 241 bool handling_key_event_; |
| 238 }; | 242 }; |
| 239 | 243 |
| 240 } // namespace input_method | 244 } // namespace input_method |
| 241 | 245 |
| 242 #endif // CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ | 246 #endif // CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_BASE_H_ |
| OLD | NEW |