summaryrefslogtreecommitdiffstats
path: root/content/renderer/render_view_impl_android.cc
diff options
context:
space:
mode:
authormlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 21:10:15 +0000
committermlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 21:10:15 +0000
commita80aea7ebc002065d8f24c54673c72cb61d47b07 (patch)
tree7a1df2525f8d03a12d72777d0a0de353ebeaa0cf /content/renderer/render_view_impl_android.cc
parent060ffdbd222874de5208580d4a1e33e021a34375 (diff)
downloadchromium_src-a80aea7ebc002065d8f24c54673c72cb61d47b07.zip
chromium_src-a80aea7ebc002065d8f24c54673c72cb61d47b07.tar.gz
chromium_src-a80aea7ebc002065d8f24c54673c72cb61d47b07.tar.bz2
Chromium plumbing to use the selection root bounds.
This is asking the selection root bounds to Blink and send it back to the RenderWidgetHostView implementation in the browser process. BUG=236033 Review URL: https://codereview.chromium.org/186753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257199 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_view_impl_android.cc')
-rw-r--r--content/renderer/render_view_impl_android.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/content/renderer/render_view_impl_android.cc b/content/renderer/render_view_impl_android.cc
index 679da54..6863c57 100644
--- a/content/renderer/render_view_impl_android.cc
+++ b/content/renderer/render_view_impl_android.cc
@@ -9,6 +9,7 @@
#include "cc/trees/layer_tree_host.h"
#include "content/common/view_messages.h"
#include "content/renderer/gpu/render_widget_compositor.h"
+#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/web/WebView.h"
namespace content {
@@ -69,4 +70,22 @@ void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) {
routing_id_, webview()->getSmartClipData(rect)));
}
+void RenderViewImpl::GetSelectionRootBounds(gfx::Rect* bounds) const {
+ blink::WebRect bounds_webrect;
+ webview()->getSelectionRootBounds(bounds_webrect);
+ *bounds = bounds_webrect;
+}
+
+void RenderViewImpl::UpdateSelectionRootBounds() {
+ if (!webview() || handling_ime_event_)
+ return;
+
+ gfx::Rect bounds;
+ GetSelectionRootBounds(&bounds);
+ if (selection_root_rect_ != bounds) {
+ selection_root_rect_ = bounds;
+ Send(new ViewHostMsg_SelectionRootBoundsChanged(routing_id_, bounds));
+ }
+}
+
} // namespace content