diff options
author | rsadam <rsadam@chromium.org> | 2015-08-13 11:42:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-13 18:42:46 +0000 |
commit | df0c56f1d2b8bb37141d368c80e677e0f8c2321d (patch) | |
tree | 2273dff2fb2ed75d58f69ac540fc6beb378c00a2 /chrome/browser/chromeos | |
parent | 2b8c376305bc468f3bd90fef42ddd86deefacdd1 (diff) | |
download | chromium_src-df0c56f1d2b8bb37141d368c80e677e0f8c2321d.zip chromium_src-df0c56f1d2b8bb37141d368c80e677e0f8c2321d.tar.gz chromium_src-df0c56f1d2b8bb37141d368c80e677e0f8c2321d.tar.bz2 |
Add text offset to OnSurroundingTextChanged.
See bug below for proposal doc.
BUG=518921
Review URL: https://codereview.chromium.org/1282823002
Cr-Commit-Position: refs/heads/master@{#343243}
Diffstat (limited to 'chrome/browser/chromeos')
7 files changed, 18 insertions, 13 deletions
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc index d985f6a..3c610f6 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine.cc +++ b/chrome/browser/chromeos/input_method/input_method_engine.cc @@ -658,13 +658,13 @@ void InputMethodEngine::CandidateClicked(uint32 index) { void InputMethodEngine::SetSurroundingText(const std::string& text, uint32 cursor_pos, - uint32 anchor_pos) { + uint32 anchor_pos, + uint32 offset_pos) { if (!CheckProfile()) return; - observer_->OnSurroundingTextChanged(active_component_id_, - text, - static_cast<int>(cursor_pos), - static_cast<int>(anchor_pos)); + observer_->OnSurroundingTextChanged( + active_component_id_, text, static_cast<int>(cursor_pos), + static_cast<int>(anchor_pos), static_cast<int>(offset_pos)); } bool InputMethodEngine::CheckProfile() const { diff --git a/chrome/browser/chromeos/input_method/input_method_engine.h b/chrome/browser/chromeos/input_method/input_method_engine.h index e0ae7e8..31a5603 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine.h +++ b/chrome/browser/chromeos/input_method/input_method_engine.h @@ -88,7 +88,8 @@ class InputMethodEngine : public InputMethodEngineInterface { void CandidateClicked(uint32 index) override; void SetSurroundingText(const std::string& text, uint32 cursor_pos, - uint32 anchor_pos) override; + uint32 anchor_pos, + uint32 offset_pos) override; void HideInputView() override; void SetCompositionBounds(const std::vector<gfx::Rect>& bounds) override; diff --git a/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc b/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc index b21d737..677025f 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc +++ b/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc @@ -194,8 +194,9 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest, ExtensionTestMessageListener surrounding_text_listener( "onSurroundingTextChanged", false); engine_handler->SetSurroundingText("text", // Surrounding text. - 0, // focused position. - 1); // anchor position. + 0, // focused position. + 1, // anchor position. + 0); // offset position. ASSERT_TRUE(surrounding_text_listener.WaitUntilSatisfied()); ASSERT_TRUE(surrounding_text_listener.was_satisfied()); diff --git a/chrome/browser/chromeos/input_method/input_method_engine_interface.h b/chrome/browser/chromeos/input_method/input_method_engine_interface.h index b183a3d..bf54842 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine_interface.h +++ b/chrome/browser/chromeos/input_method/input_method_engine_interface.h @@ -171,7 +171,8 @@ class InputMethodEngineInterface : public IMEEngineHandlerInterface { virtual void OnSurroundingTextChanged(const std::string& engine_id, const std::string& text, int cursor_pos, - int anchor_pos) = 0; + int anchor_pos, + int offset_pos) = 0; // Called when composition bounds are changed. virtual void OnCompositionBoundsChanged( diff --git a/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc b/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc index 6e7e599..8a9eb91 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc +++ b/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc @@ -95,7 +95,8 @@ class TestObserver : public InputMethodEngineInterface::Observer { void OnSurroundingTextChanged(const std::string& engine_id, const std::string& text, int cursor_pos, - int anchor_pos) override {} + int anchor_pos, + int offset) override {} void OnCompositionBoundsChanged( const std::vector<gfx::Rect>& bounds) override { calls_bitmap_ |= ONCOMPOSITIONBOUNDSCHANGED; diff --git a/chrome/browser/chromeos/input_method/mock_input_method_engine.cc b/chrome/browser/chromeos/input_method/mock_input_method_engine.cc index 0094309..852a095 100644 --- a/chrome/browser/chromeos/input_method/mock_input_method_engine.cc +++ b/chrome/browser/chromeos/input_method/mock_input_method_engine.cc @@ -130,8 +130,8 @@ void MockInputMethodEngine::CandidateClicked(uint32 index) { void MockInputMethodEngine::SetSurroundingText(const std::string& text, uint32 cursor_pos, - uint32 anchor_pos) { -} + uint32 anchor_pos, + uint32 offset_pos) {} void MockInputMethodEngine::SetCompositionBounds( const std::vector<gfx::Rect>& bounds) { diff --git a/chrome/browser/chromeos/input_method/mock_input_method_engine.h b/chrome/browser/chromeos/input_method/mock_input_method_engine.h index 3a60575..5151d39 100644 --- a/chrome/browser/chromeos/input_method/mock_input_method_engine.h +++ b/chrome/browser/chromeos/input_method/mock_input_method_engine.h @@ -80,7 +80,8 @@ class MockInputMethodEngine : public InputMethodEngineInterface { void CandidateClicked(uint32 index) override; void SetSurroundingText(const std::string& text, uint32 cursor_pos, - uint32 anchor_pos) override; + uint32 anchor_pos, + uint32 offset_pos) override; void SetCompositionBounds(const std::vector<gfx::Rect>& bounds) override; void HideInputView() override; |