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

Unified Diff: content/browser/browser_plugin/browser_plugin_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/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 22696314621b4af82d931e56373010603b803114..d17745f40fd60000d7f1e34e47f55c5d9a6cdb83 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -38,6 +38,7 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/drop_data.h"
+#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#if defined(OS_MACOSX)
@@ -453,10 +454,16 @@ WebContentsImpl* BrowserPluginGuest::GetWebContents() const {
gfx::Point BrowserPluginGuest::GetScreenCoordinates(
const gfx::Point& relative_position) const {
+ return gfx::ToRoundedPoint(
+ GetScreenCoordinates(gfx::PointF(relative_position)));
+}
+
+gfx::PointF BrowserPluginGuest::GetScreenCoordinates(
+ const gfx::PointF& relative_position) const {
if (!attached())
return relative_position;
- gfx::Point screen_pos(relative_position);
+ gfx::PointF screen_pos(relative_position);
screen_pos += guest_window_rect_.OffsetFromOrigin();
if (embedder_web_contents()->GetBrowserPluginGuest()) {
BrowserPluginGuest* embedder_guest =
@@ -465,7 +472,6 @@ gfx::Point BrowserPluginGuest::GetScreenCoordinates(
}
return screen_pos;
}
-
void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
if (!attached()) {
// Some pages such as data URLs, javascript URLs, and about:blank
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/browser/frame_host/render_widget_host_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698