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

Unified Diff: content/browser/frame_host/render_widget_host_view_guest.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/frame_host/render_widget_host_view_guest.cc
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index dee512201fa42dd20f15dd2f97cd8ecf79e9a6ac..5a52e0d6f9bd98065db5dbbae4c6e8f1b8e648fb 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
+#include "cc/output/viewport_selection_bound.h"
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_manager.h"
@@ -221,6 +222,24 @@ void RenderWidgetHostViewGuest::OnSwapCompositorFrame(
return;
}
+ DCHECK(platform_view_);
+ // Only forward our selection information if (1) we have focus, and (2) our
+ // focused node isn't a plugin (which might be a nested browser plugin, in
+ // which case its RenderWidgetHoseViewGuest will forward the selection
+ // information).
+ if (guest_->focused() && !platform_view_->focused_node_is_plugin()) {
+ cc::ViewportSelectionBound start = frame->metadata.selection.start;
+ gfx::PointF edge_top = guest_->GetScreenCoordinates(start.edge_top);
+ gfx::PointF edge_bottom = guest_->GetScreenCoordinates(start.edge_bottom);
+ fprintf(stderr, "wjm: RWHVG::OnSwapCompositorFrame(%p) Screen "
+ "edge_top=(%6.1f,%6.1f) edge_bottom=(%6.1f,%6.1f)\n",
+ this, edge_top.x(), edge_top.y(), edge_bottom.x(), edge_bottom.y());
+ fprintf(stderr, "wjm: RWHVG::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());
+ }
+
cc::RenderPass* root_pass =
frame->delegated_frame_data->render_pass_list.back();
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698