summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 14:02:13 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 14:02:13 +0000
commit260969bfeef6e5793a6143e77b69daac19d1088d (patch)
treea4084e5561bed56728bfe00d8d0417161a464401
parentc5dae7d2d9d70d023f06a7734033c11ba96dfcc8 (diff)
downloadchromium_src-260969bfeef6e5793a6143e77b69daac19d1088d.zip
chromium_src-260969bfeef6e5793a6143e77b69daac19d1088d.tar.gz
chromium_src-260969bfeef6e5793a6143e77b69daac19d1088d.tar.bz2
Revert 240602 "Use the caret bounds as a fallback when GetCompos..."
Broke RemoteInputMethodWinTest.OnCaretBoundsChanged base\ime\remote_input_method_win_unittest.cc(423): error: Value of: mock_remote_delegate.composition_character_bounds() > Use the caret bounds as a fallback when GetCompositionCharacterBounds is not available > > This CL fixes a positional issue of IMEs' candidate window on PPAPI Flash running under Ash mode. > > The root cause is that PPAPI does not support TextInputClient::GetCompositionCharacterBounds at all. We once worked around this in Issue 148903 but the Win/Ash backend lacked of this treatment. > > BUG=328237 > TEST=manually done on Windows 8.1 > > Review URL: https://codereview.chromium.org/109323009 TBR=yukawa@chromium.org Review URL: https://codereview.chromium.org/93933009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240627 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/base/ime/remote_input_method_win.cc27
1 files changed, 11 insertions, 16 deletions
diff --git a/ui/base/ime/remote_input_method_win.cc b/ui/base/ime/remote_input_method_win.cc
index af450fe..cc5fc20 100644
--- a/ui/base/ime/remote_input_method_win.cc
+++ b/ui/base/ime/remote_input_method_win.cc
@@ -85,24 +85,19 @@ std::vector<gfx::Rect> GetCompositionCharacterBounds(
if (!client)
return std::vector<gfx::Rect>();
- std::vector<gfx::Rect> bounds;
- if (client->HasCompositionText()) {
- gfx::Range range;
- if (client->GetCompositionTextRange(&range)) {
- for (uint32 i = 0; i < range.length(); ++i) {
- gfx::Rect rect;
- if (!client->GetCompositionCharacterBounds(i, &rect))
- break;
- bounds.push_back(rect);
- }
- }
+ if (!client->HasCompositionText()) {
+ std::vector<gfx::Rect> caret;
+ caret.push_back(client->GetCaretBounds());
+ return caret;
}
- // Use the caret bounds as a fallback if no composition character bounds is
- // available. One typical use case is PPAPI Flash, which does not support
- // GetCompositionCharacterBounds at all. crbug.com/133472
- if (bounds.empty())
- bounds.push_back(client->GetCaretBounds());
+ std::vector<gfx::Rect> bounds;
+ for (uint32 i = 0;; ++i) {
+ gfx::Rect rect;
+ if (!client->GetCompositionCharacterBounds(i, &rect))
+ break;
+ bounds.push_back(rect);
+ }
return bounds;
}