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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 } | 2361 } |
2362 | 2362 |
2363 void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id, | 2363 void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id, |
2364 bool result) { | 2364 bool result) { |
2365 RenderViewHostImpl* rvh = GetRenderViewHostImpl(); | 2365 RenderViewHostImpl* rvh = GetRenderViewHostImpl(); |
2366 rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(), | 2366 rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(), |
2367 request_id, | 2367 request_id, |
2368 result)); | 2368 result)); |
2369 } | 2369 } |
2370 | 2370 |
2371 void WebContentsImpl::OnBrowserPluginNavigateGuest(int instance_id, | 2371 void WebContentsImpl::OnBrowserPluginNavigateGuest( |
2372 const std::string& src, | 2372 int instance_id, |
2373 const gfx::Size& size) { | 2373 const std::string& src, |
| 2374 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { |
2374 // This is the first 'navigate' to a browser plugin, before WebContents has/is | 2375 // This is the first 'navigate' to a browser plugin, before WebContents has/is |
2375 // an 'Embedder'; subsequent navigate messages for this WebContents will | 2376 // an 'Embedder'; subsequent navigate messages for this WebContents will |
2376 // be handled by the BrowserPluginEmbedderHelper of the embedder itself (this | 2377 // be handled by the BrowserPluginEmbedderHelper of the embedder itself (this |
2377 // also means any message from browser plugin renderer prior to NavigateGuest | 2378 // also means any message from browser plugin renderer prior to NavigateGuest |
2378 // which is not NavigateGuest will be ignored). Therefore | 2379 // which is not NavigateGuest will be ignored). Therefore |
2379 // |browser_plugin_embedder_| should not be set. | 2380 // |browser_plugin_embedder_| should not be set. |
2380 // For more info, see comment above classes BrowserPluginEmbedder and | 2381 // For more info, see comment above classes BrowserPluginEmbedder and |
2381 // BrowserPluginGuest. | 2382 // BrowserPluginGuest. |
2382 CHECK(!browser_plugin_embedder_.get()); | 2383 CHECK(!browser_plugin_embedder_.get()); |
2383 | 2384 |
2384 browser_plugin_embedder_.reset( | 2385 browser_plugin_embedder_.reset( |
2385 content::BrowserPluginEmbedder::Create(this, GetRenderViewHost())); | 2386 content::BrowserPluginEmbedder::Create(this, GetRenderViewHost())); |
2386 browser_plugin_embedder_->NavigateGuest(GetRenderViewHost(), | 2387 browser_plugin_embedder_->NavigateGuest(GetRenderViewHost(), |
2387 instance_id, | 2388 instance_id, |
2388 src, | 2389 src, |
2389 size); | 2390 resize_params); |
2390 } | 2391 } |
2391 | 2392 |
2392 // Notifies the RenderWidgetHost instance about the fact that the page is | 2393 // Notifies the RenderWidgetHost instance about the fact that the page is |
2393 // loading, or done loading and calls the base implementation. | 2394 // loading, or done loading and calls the base implementation. |
2394 void WebContentsImpl::SetIsLoading(bool is_loading, | 2395 void WebContentsImpl::SetIsLoading(bool is_loading, |
2395 LoadNotificationDetails* details) { | 2396 LoadNotificationDetails* details) { |
2396 if (is_loading == is_loading_) | 2397 if (is_loading == is_loading_) |
2397 return; | 2398 return; |
2398 | 2399 |
2399 if (!is_loading) { | 2400 if (!is_loading) { |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3381 } | 3382 } |
3382 } | 3383 } |
3383 | 3384 |
3384 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3385 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3385 return browser_plugin_guest_.get(); | 3386 return browser_plugin_guest_.get(); |
3386 } | 3387 } |
3387 | 3388 |
3388 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3389 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3389 return browser_plugin_embedder_.get(); | 3390 return browser_plugin_embedder_.get(); |
3390 } | 3391 } |
OLD | NEW |