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 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2336 } | 2336 } |
2337 | 2337 |
2338 void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id, | 2338 void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id, |
2339 bool result) { | 2339 bool result) { |
2340 RenderViewHostImpl* rvh = GetRenderViewHostImpl(); | 2340 RenderViewHostImpl* rvh = GetRenderViewHostImpl(); |
2341 rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(), | 2341 rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(), |
2342 request_id, | 2342 request_id, |
2343 result)); | 2343 result)); |
2344 } | 2344 } |
2345 | 2345 |
2346 void WebContentsImpl::OnBrowserPluginNavigateGuest(int instance_id, | 2346 void WebContentsImpl::OnBrowserPluginNavigateGuest( |
2347 int64 frame_id, | 2347 int instance_id, |
2348 const std::string& src, | 2348 int64 frame_id, |
2349 const gfx::Size& size) { | 2349 const std::string& src, |
| 2350 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params) { |
2350 // This is the first 'navigate' to a browser plugin, before WebContents has/is | 2351 // This is the first 'navigate' to a browser plugin, before WebContents has/is |
2351 // an 'Embedder'; subsequent navigate messages for this WebContents will | 2352 // an 'Embedder'; subsequent navigate messages for this WebContents will |
2352 // be handled by the BrowserPluginEmbedderHelper of the embedder itself (this | 2353 // be handled by the BrowserPluginEmbedderHelper of the embedder itself (this |
2353 // also means any message from browser plugin renderer prior to NavigateGuest | 2354 // also means any message from browser plugin renderer prior to NavigateGuest |
2354 // which is not NavigateGuest will be ignored). Therefore | 2355 // which is not NavigateGuest will be ignored). Therefore |
2355 // |browser_plugin_embedder_| should not be set. | 2356 // |browser_plugin_embedder_| should not be set. |
2356 // For more info, see comment above classes BrowserPluginEmbedder and | 2357 // For more info, see comment above classes BrowserPluginEmbedder and |
2357 // BrowserPluginGuest. | 2358 // BrowserPluginGuest. |
2358 CHECK(!browser_plugin_embedder_.get()); | 2359 CHECK(!browser_plugin_embedder_.get()); |
2359 | 2360 |
2360 browser_plugin_embedder_.reset( | 2361 browser_plugin_embedder_.reset( |
2361 content::BrowserPluginEmbedder::Create(this, GetRenderViewHost())); | 2362 content::BrowserPluginEmbedder::Create(this, GetRenderViewHost())); |
2362 browser_plugin_embedder_->NavigateGuest(GetRenderViewHost(), | 2363 browser_plugin_embedder_->NavigateGuest(GetRenderViewHost(), |
2363 instance_id, | 2364 instance_id, |
2364 frame_id, | 2365 frame_id, |
2365 src, | 2366 src, |
2366 size); | 2367 resize_params); |
2367 } | 2368 } |
2368 | 2369 |
2369 // Notifies the RenderWidgetHost instance about the fact that the page is | 2370 // Notifies the RenderWidgetHost instance about the fact that the page is |
2370 // loading, or done loading and calls the base implementation. | 2371 // loading, or done loading and calls the base implementation. |
2371 void WebContentsImpl::SetIsLoading(bool is_loading, | 2372 void WebContentsImpl::SetIsLoading(bool is_loading, |
2372 LoadNotificationDetails* details) { | 2373 LoadNotificationDetails* details) { |
2373 if (is_loading == is_loading_) | 2374 if (is_loading == is_loading_) |
2374 return; | 2375 return; |
2375 | 2376 |
2376 if (!is_loading) { | 2377 if (!is_loading) { |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3366 } | 3367 } |
3367 } | 3368 } |
3368 | 3369 |
3369 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3370 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3370 return browser_plugin_guest_.get(); | 3371 return browser_plugin_guest_.get(); |
3371 } | 3372 } |
3372 | 3373 |
3373 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3374 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3374 return browser_plugin_embedder_.get(); | 3375 return browser_plugin_embedder_.get(); |
3375 } | 3376 } |
OLD | NEW |