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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 354483004: Implement <appview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Fixed formatting Created 6 years, 5 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 5b88849176f9298bb728523fd702af2b09d731cb..ef729e4b0596498a9955642a94894392af461e54 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -292,6 +292,11 @@ BrowserPluginGuest::GetBrowserPluginGuestManager() const {
gfx::Rect BrowserPluginGuest::ToGuestRect(const gfx::Rect& bounds) {
gfx::Rect guest_rect(bounds);
guest_rect.Offset(guest_window_rect_.OffsetFromOrigin());
+ if (embedder_web_contents()->GetBrowserPluginGuest()) {
+ BrowserPluginGuest* embedder_guest =
+ embedder_web_contents()->GetBrowserPluginGuest();
+ guest_rect.Offset(embedder_guest->guest_window_rect_.OffsetFromOrigin());
+ }
return guest_rect;
}
@@ -311,8 +316,16 @@ WebContentsImpl* BrowserPluginGuest::GetWebContents() const {
gfx::Point BrowserPluginGuest::GetScreenCoordinates(
const gfx::Point& relative_position) const {
+ if (!attached())
+ return relative_position;
+
gfx::Point screen_pos(relative_position);
screen_pos += guest_window_rect_.OffsetFromOrigin();
+ if (embedder_web_contents()->GetBrowserPluginGuest()) {
+ BrowserPluginGuest* embedder_guest =
+ embedder_web_contents()->GetBrowserPluginGuest();
+ screen_pos += embedder_guest->guest_window_rect_.OffsetFromOrigin();
+ }
return screen_pos;
}
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/shim/test.js ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698