Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: content/renderer/render_view_impl_android.cc

Issue 186753002: Chromium plumbing to use the selection root bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on Blink patch and OS_ANDROID specific Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl_android.cc
diff --git a/content/renderer/render_view_impl_android.cc b/content/renderer/render_view_impl_android.cc
index 679da548f91dc2f487931c0658d3e1cddf60c8ed..7c8db08de52728a5807251cfe504364c0e8cdb43 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,23 @@ 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_) {
jochen (gone - plz use gerrit) 2014/03/12 13:01:00 nit. no { }
mlamouri (slow - plz ping) 2014/03/12 14:24:11 Done.
+ return;
+ }
+
+ gfx::Rect bounds;
+ GetSelectionRootBounds(&bounds);
+ if (selection_root_rect_ != bounds) {
+ selection_root_rect_ = bounds;
+ Send(new ViewHostMsg_SelectionRootBoundsChanged(routing_id_, bounds));
+ }
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698