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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 1203223002: [Experimental, WIP] Demo version of extracting WebView selection data from CompositorFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/browser/renderer_host/render_widget_host_view_aura.cc
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 5483d015acf38f59223043d66ba7284904ddb031..d454473858541f61e10a9c2c762533f192ae00aa 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1170,6 +1170,18 @@ void RenderWidgetHostViewAura::OnSwapCompositorFrame(
scoped_ptr<cc::CompositorFrame> frame) {
TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame");
+ if (!focused_node_is_plugin()) {
+ cc::ViewportSelectionBound start = frame->metadata.selection.start;
+ fprintf(stderr, "wjm: RWHVA::OnSwapCompositorFrame(%p) Window "
+ "edge_top=(%6.1f,%6.1f) edge_bottom=(%6.1f,%6.1f)\n",
+ this, start.edge_top.x(), start.edge_top.y(),
+ start.edge_bottom.x(), start.edge_bottom.y());
+ } else {
+ // This is just to demonstrate when RWHVA *shouldn't* send selection info.
+ fprintf(stderr, "wjm: RWHVA::OnSwapCompositorFrame(%p) - not focused\n",
+ this);
+ }
+
last_scroll_offset_ = frame->metadata.root_scroll_offset;
if (frame->delegated_frame_data) {
delegated_frame_host_->SwapDelegatedFrame(

Powered by Google App Engine
This is Rietveld 408576698