| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 6 | 6 |
| 7 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 7 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/common/browser_plugin/browser_plugin_messages.h" | 10 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // Returns false to iterate over all guests. | 58 // Returns false to iterate over all guests. |
| 59 return false; | 59 return false; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void BrowserPluginEmbedder::ScreenInfoChanged() { | 62 void BrowserPluginEmbedder::ScreenInfoChanged() { |
| 63 GetBrowserPluginGuestManager()->ForEachGuest(web_contents(), base::Bind( | 63 GetBrowserPluginGuestManager()->ForEachGuest(web_contents(), base::Bind( |
| 64 &BrowserPluginEmbedder::NotifyScreenInfoChanged)); | 64 &BrowserPluginEmbedder::NotifyScreenInfoChanged)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 // static |
| 68 bool BrowserPluginEmbedder::CancelDialogs(WebContents* guest_web_contents) { |
| 69 static_cast<WebContentsImpl*>(guest_web_contents) |
| 70 ->CancelActiveAndPendingDialogs(); |
| 71 |
| 72 // Returns false to iterate over all guests. |
| 73 return false; |
| 74 } |
| 75 |
| 76 void BrowserPluginEmbedder::CancelGuestDialogs() { |
| 77 GetBrowserPluginGuestManager()->ForEachGuest( |
| 78 web_contents(), base::Bind(&BrowserPluginEmbedder::CancelDialogs)); |
| 79 } |
| 80 |
| 67 void BrowserPluginEmbedder::StartDrag(BrowserPluginGuest* guest) { | 81 void BrowserPluginEmbedder::StartDrag(BrowserPluginGuest* guest) { |
| 68 guest_started_drag_ = guest->AsWeakPtr(); | 82 guest_started_drag_ = guest->AsWeakPtr(); |
| 69 guest_drag_ending_ = false; | 83 guest_drag_ending_ = false; |
| 70 } | 84 } |
| 71 | 85 |
| 72 BrowserPluginGuestManager* | 86 BrowserPluginGuestManager* |
| 73 BrowserPluginEmbedder::GetBrowserPluginGuestManager() const { | 87 BrowserPluginEmbedder::GetBrowserPluginGuestManager() const { |
| 74 return web_contents()->GetBrowserContext()->GetGuestManager(); | 88 return web_contents()->GetBrowserContext()->GetGuestManager(); |
| 75 } | 89 } |
| 76 | 90 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 *mouse_unlocked |= static_cast<WebContentsImpl*>(guest) | 208 *mouse_unlocked |= static_cast<WebContentsImpl*>(guest) |
| 195 ->GetBrowserPluginGuest() | 209 ->GetBrowserPluginGuest() |
| 196 ->mouse_locked(); | 210 ->mouse_locked(); |
| 197 guest->GotResponseToLockMouseRequest(false); | 211 guest->GotResponseToLockMouseRequest(false); |
| 198 | 212 |
| 199 // Returns false to iterate over all guests. | 213 // Returns false to iterate over all guests. |
| 200 return false; | 214 return false; |
| 201 } | 215 } |
| 202 | 216 |
| 203 } // namespace content | 217 } // namespace content |
| OLD | NEW |