Chromium Code Reviews| 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_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 745 Initialize(embedder_web_contents, params); | 745 Initialize(embedder_web_contents, params); |
| 746 | 746 |
| 747 // We initialize the RenderViewHost after a BrowserPlugin has been attached | 747 // We initialize the RenderViewHost after a BrowserPlugin has been attached |
| 748 // to it and is ready to receive pixels. Until a RenderViewHost is | 748 // to it and is ready to receive pixels. Until a RenderViewHost is |
| 749 // initialized, it will not allow any resize requests. | 749 // initialized, it will not allow any resize requests. |
| 750 if (!GetWebContents()->GetRenderViewHost()->IsRenderViewLive()) { | 750 if (!GetWebContents()->GetRenderViewHost()->IsRenderViewLive()) { |
| 751 static_cast<RenderViewHostImpl*>( | 751 static_cast<RenderViewHostImpl*>( |
| 752 GetWebContents()->GetRenderViewHost())->Init(); | 752 GetWebContents()->GetRenderViewHost())->Init(); |
| 753 } | 753 } |
| 754 | 754 |
| 755 // Inform the embedder BrowserPlugin of the attached guest. | 755 const GURL& site_url = GetWebContents()->GetSiteInstance()->GetSiteURL(); |
|
Charlie Reis
2013/04/04 21:30:23
nit: Move this declaration below the comment, and
| |
| 756 if (!name_.empty()) { | 756 // Inform the embedder of the guest's information. |
| 757 SendMessageToEmbedder( | 757 BrowserPluginMsg_Attach_ACK_Params ack_params; |
| 758 new BrowserPluginMsg_UpdatedName(instance_id_, name_)); | 758 ack_params.storage_partition_id = site_url.query(); |
| 759 } | 759 ack_params.persist_storage = |
| 760 site_url.path().find("persist") != std::string::npos; | |
| 761 ack_params.name = name_; | |
| 762 SendMessageToEmbedder( | |
| 763 new BrowserPluginMsg_Attach_ACK(instance_id_, ack_params)); | |
| 760 } | 764 } |
| 761 | 765 |
| 762 void BrowserPluginGuest::OnCompositorFrameACK( | 766 void BrowserPluginGuest::OnCompositorFrameACK( |
| 763 int instance_id, | 767 int instance_id, |
| 764 int route_id, | 768 int route_id, |
| 765 int renderer_host_id, | 769 int renderer_host_id, |
| 766 const cc::CompositorFrameAck& ack) { | 770 const cc::CompositorFrameAck& ack) { |
| 767 RenderWidgetHostImpl::SendSwapCompositorFrameAck(route_id, | 771 RenderWidgetHostImpl::SendSwapCompositorFrameAck(route_id, |
| 768 renderer_host_id, | 772 renderer_host_id, |
| 769 ack); | 773 ack); |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1317 base::Value::CreateStringValue(request_method)); | 1321 base::Value::CreateStringValue(request_method)); |
| 1318 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); | 1322 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); |
| 1319 | 1323 |
| 1320 SendMessageToEmbedder( | 1324 SendMessageToEmbedder( |
| 1321 new BrowserPluginMsg_RequestPermission(instance_id(), | 1325 new BrowserPluginMsg_RequestPermission(instance_id(), |
| 1322 BrowserPluginPermissionTypeDownload, permission_request_id, | 1326 BrowserPluginPermissionTypeDownload, permission_request_id, |
| 1323 request_info)); | 1327 request_info)); |
| 1324 } | 1328 } |
| 1325 | 1329 |
| 1326 } // namespace content | 1330 } // namespace content |
| OLD | NEW |