| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (guest_started_drag_) | 98 if (guest_started_drag_) |
| 99 guest_started_drag_.reset(); | 99 guest_started_drag_.reset(); |
| 100 } else { | 100 } else { |
| 101 guest_drag_ending_ = true; | 101 guest_drag_ending_ = true; |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 // static | 105 // static |
| 106 bool BrowserPluginEmbedder::DidSendScreenRectsCallback( | 106 bool BrowserPluginEmbedder::DidSendScreenRectsCallback( |
| 107 WebContents* guest_web_contents) { | 107 WebContents* guest_web_contents) { |
| 108 static_cast<RenderViewHostImpl*>( | 108 RenderWidgetHostImpl::From( |
| 109 guest_web_contents->GetRenderViewHost())->SendScreenRects(); | 109 guest_web_contents->GetRenderViewHost()->GetWidget()) |
| 110 ->SendScreenRects(); |
| 110 // Not handled => Iterate over all guests. | 111 // Not handled => Iterate over all guests. |
| 111 return false; | 112 return false; |
| 112 } | 113 } |
| 113 | 114 |
| 114 void BrowserPluginEmbedder::DidSendScreenRects() { | 115 void BrowserPluginEmbedder::DidSendScreenRects() { |
| 115 GetBrowserPluginGuestManager()->ForEachGuest( | 116 GetBrowserPluginGuestManager()->ForEachGuest( |
| 116 web_contents(), | 117 web_contents(), |
| 117 base::Bind(&BrowserPluginEmbedder::DidSendScreenRectsCallback)); | 118 base::Bind(&BrowserPluginEmbedder::DidSendScreenRectsCallback)); |
| 118 } | 119 } |
| 119 | 120 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 if (static_cast<WebContentsImpl*>(guest)->GetBrowserPluginGuest() | 252 if (static_cast<WebContentsImpl*>(guest)->GetBrowserPluginGuest() |
| 252 ->StopFinding(action)) { | 253 ->StopFinding(action)) { |
| 253 // There can only ever currently be one browser plugin that handles find so | 254 // There can only ever currently be one browser plugin that handles find so |
| 254 // we can break the iteration at this point. | 255 // we can break the iteration at this point. |
| 255 return true; | 256 return true; |
| 256 } | 257 } |
| 257 return false; | 258 return false; |
| 258 } | 259 } |
| 259 | 260 |
| 260 } // namespace content | 261 } // namespace content |
| OLD | NEW |