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(); |