diff options
author | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-11 19:27:16 +0000 |
---|---|---|
committer | fsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-11 19:27:16 +0000 |
commit | 3d888fa664cae831addd01b8bfbc999a0bcda011 (patch) | |
tree | 3fcaa2df9d2d5dfe587871ad94555497162a7f2d /content/browser/browser_plugin/browser_plugin_guest.cc | |
parent | a3c13435c27b7dfcac1e60123576a226dbd18bf1 (diff) | |
download | chromium_src-3d888fa664cae831addd01b8bfbc999a0bcda011.zip chromium_src-3d888fa664cae831addd01b8bfbc999a0bcda011.tar.gz chromium_src-3d888fa664cae831addd01b8bfbc999a0bcda011.tar.bz2 |
Implement <appview>
This is the first working CL of <appview>. This CL implements the basic permission API with the onAppEmbeddingRequest event.
BUG=364141
Review URL: https://codereview.chromium.org/354483004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_plugin/browser_plugin_guest.cc')
-rw-r--r-- | content/browser/browser_plugin/browser_plugin_guest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 5b88849..ef729e4 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; } |