summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-13 06:04:28 +0000
committerYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-13 06:04:28 +0000
commit409d59cb852fa4c924cc61ead8d672a05e2fb7a8 (patch)
tree4348b2e7f2cb7ee771d48135e91ff55126447996 /ui
parentcb0e431b5b17f64e68d3313b0ca6c5b591343564 (diff)
downloadchromium_src-409d59cb852fa4c924cc61ead8d672a05e2fb7a8.zip
chromium_src-409d59cb852fa4c924cc61ead8d672a05e2fb7a8.tar.gz
chromium_src-409d59cb852fa4c924cc61ead8d672a05e2fb7a8.tar.bz2
Return caret bounds in local coordinates from GetCaretBoundsInWidget
This is another regression caused by r197858. There remains another call site of TextInputClient::GetCaretBounds, which now returns the caret rect as screen coordinate as documented in the header. BUG=239737 TEST=Manually done on Windows 7 with built-in Chinese IME. Review URL: https://chromiumcodereview.appspot.com/14731011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/ime/input_method_base.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/views/ime/input_method_base.cc b/ui/views/ime/input_method_base.cc
index ff1ed1e..e72c054 100644
--- a/ui/views/ime/input_method_base.cc
+++ b/ui/views/ime/input_method_base.cc
@@ -86,7 +86,11 @@ bool InputMethodBase::GetCaretBoundsInWidget(gfx::Rect* rect) const {
if (!client || client->GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE)
return false;
- *rect = GetFocusedView()->ConvertRectToWidget(client->GetCaretBounds());
+ gfx::Rect caret_bounds = client->GetCaretBounds();
+ gfx::Point caret_origin = caret_bounds.origin();
+ View::ConvertPointFromScreen(GetFocusedView(), &caret_origin);
+ caret_bounds.set_origin(caret_origin);
+ *rect = GetFocusedView()->ConvertRectToWidget(caret_bounds);
// Convert coordinates if the focused view is inside a child Widget.
if (GetFocusedView()->GetWidget() != widget_)