summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authornona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 16:49:44 +0000
committernona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 16:49:44 +0000
commitb0ddd14c6fef8a42cd922ff62dce62fb3e89439e (patch)
treeb9085ea292f1064299dd514b28d901365f8acd65 /content
parent5d5374e81aaba568c24eb2d983958725de4240a3 (diff)
downloadchromium_src-b0ddd14c6fef8a42cd922ff62dce62fb3e89439e.zip
chromium_src-b0ddd14c6fef8a42cd922ff62dce62fb3e89439e.tar.gz
chromium_src-b0ddd14c6fef8a42cd922ff62dce62fb3e89439e.tar.bz2
Converts composition bounds coordinates.
Converts composition bounds rectangle coordinate to screen coordinate to show candidate window at correct position. BUG=133428 TEST=manually done on alex Review URL: https://chromiumcodereview.appspot.com/10559057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142973 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc10
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.h3
2 files changed, 10 insertions, 3 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 99c396a..d5f2bed 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -809,8 +809,7 @@ bool RenderWidgetHostViewAura::CanComposeInline() const {
return can_compose_inline_;
}
-gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() {
- const gfx::Rect rect = selection_start_rect_.Union(selection_end_rect_);
+gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(const gfx::Rect& rect) {
gfx::Point origin = rect.origin();
gfx::Point end = gfx::Point(rect.right(), rect.bottom());
@@ -827,12 +826,17 @@ gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() {
end.y() - origin.y());
}
+gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() {
+ const gfx::Rect rect = selection_start_rect_.Union(selection_end_rect_);
+ return ConvertRectToScreen(rect);
+}
+
bool RenderWidgetHostViewAura::GetCompositionCharacterBounds(uint32 index,
gfx::Rect* rect) {
DCHECK(rect);
if (index >= composition_character_bounds_.size())
return false;
- *rect = composition_character_bounds_[index];
+ *rect = ConvertRectToScreen(composition_character_bounds_[index]);
return true;
}
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index 21046043..d94a9d5 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -238,6 +238,9 @@ class RenderWidgetHostViewAura
// Detaches |this| from the input method object.
void DetachFromInputMethod();
+ // Converts |rect| from window coordinate to screen coordinate.
+ gfx::Rect ConvertRectToScreen(const gfx::Rect& rect);
+
// The model object.
content::RenderWidgetHostImpl* host_;