diff options
author | azurewei <azurewei@chromium.org> | 2016-01-11 03:10:19 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-11 11:11:33 +0000 |
commit | a8dc1724d107578d46f10a232aa5b3fe51b5c6b6 (patch) | |
tree | 4ded3b1a48c97848eba101323e6767ecb98b9faa /ui/base | |
parent | e05d480189faac51c2cfa964731f33d445ce6d48 (diff) | |
download | chromium_src-a8dc1724d107578d46f10a232aa5b3fe51b5c6b6.zip chromium_src-a8dc1724d107578d46f10a232aa5b3fe51b5c6b6.tar.gz chromium_src-a8dc1724d107578d46f10a232aa5b3fe51b5c6b6.tar.bz2 |
Change some functions in ImeEngineObserver as not ChromeOS-only.
This cl makes functions: OnActivate(), IsInterestedInKeyEvent(), OnSurroundingTextChanged() in ui::IMEEngineObserver not ChromeOS only, as these related input.ime.* API should be reused on Linux and Windows.
Function GetCurrentScreenType() is declared virtual in ImeObserver, as it will be used for OnActivate().
BUG=517773
TEST=No compiling errors.
Review URL: https://codereview.chromium.org/1573903002
Cr-Commit-Position: refs/heads/master@{#368564}
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/ime/ime_engine_observer.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/ui/base/ime/ime_engine_observer.h b/ui/base/ime/ime_engine_observer.h index 3bdcab1..7a2bf9d 100644 --- a/ui/base/ime/ime_engine_observer.h +++ b/ui/base/ime/ime_engine_observer.h @@ -14,6 +14,9 @@ class IMEEngineObserver { public: virtual ~IMEEngineObserver() {} + // Called when the IME becomes the active IME. + virtual void OnActivate(const std::string& engine_id) = 0; + // Called when a text field gains focus, and will be sending key events. virtual void OnFocus( const IMEEngineHandlerInterface::InputContext& context) = 0; @@ -37,6 +40,16 @@ class IMEEngineObserver { virtual void OnCompositionBoundsChanged( const std::vector<gfx::Rect>& bounds) = 0; + // Returns whether the observer is interested in key events. + virtual bool IsInterestedInKeyEvent() const = 0; + + // Called when a surrounding text is changed. + virtual void OnSurroundingTextChanged(const std::string& engine_id, + const std::string& text, + int cursor_pos, + int anchor_pos, + int offset_pos) = 0; + // ChromeOS only APIs. #if defined(OS_CHROMEOS) @@ -46,15 +59,11 @@ class IMEEngineObserver { MOUSE_BUTTON_MIDDLE, }; - // Called when the IME becomes the active IME. - virtual void OnActivate(const std::string& engine_id) = 0; - // Called when an InputContext's properties change while it is focused. virtual void OnInputContextUpdate( const IMEEngineHandlerInterface::InputContext& context) = 0; - // Returns whether the observer is interested in key events. - virtual bool IsInterestedInKeyEvent() const = 0; + // Called when the user clicks on an item in the candidate list. virtual void OnCandidateClicked(const std::string& engine_id, @@ -64,13 +73,6 @@ class IMEEngineObserver { // Called when a menu item for this IME is interacted with. virtual void OnMenuItemActivated(const std::string& engine_id, const std::string& menu_id) = 0; - - // Called when a surrounding text is changed. - virtual void OnSurroundingTextChanged(const std::string& engine_id, - const std::string& text, - int cursor_pos, - int anchor_pos, - int offset_pos) = 0; #endif }; |