Chromium Code Reviews| Index: content/browser/browser_plugin/browser_plugin_guest.cc |
| diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
| index 0eebca783f0dc31122a20ac916e1fd3de55979fa..f04601fedad439c3add3755687be2bb3400bfd0b 100644 |
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc |
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
| @@ -199,7 +199,9 @@ bool BrowserPluginGuest::OnMessageReceivedFromEmbedder( |
| void BrowserPluginGuest::Initialize( |
| const BrowserPluginHostMsg_Attach_Params& params, |
| - WebContentsImpl* embedder_web_contents) { |
| + WebContentsImpl* embedder_web_contents, |
| + const base::DictionaryValue& extra_params) { |
| + printf("BPG::Initialize()\n"); |
| focused_ = params.focused; |
| guest_visible_ = params.visible; |
| guest_opaque_ = params.opaque; |
| @@ -252,12 +254,6 @@ void BrowserPluginGuest::Initialize( |
| new BrowserPluginMsg_GuestContentWindowReady(instance_id_, |
| guest_routing_id)); |
| - if (!params.src.empty()) { |
| - // params.src will be validated in BrowserPluginGuest::OnNavigateGuest. |
| - OnNavigateGuest(instance_id_, params.src); |
| - has_render_view_ = true; |
| - } |
| - |
| WebPreferences prefs = GetWebContents()->GetWebkitPrefs(); |
| prefs.navigate_on_drag_drop = false; |
| GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); |
| @@ -281,8 +277,11 @@ void BrowserPluginGuest::Initialize( |
| SendMessageToEmbedder( |
| new BrowserPluginMsg_Attach_ACK(instance_id_, ack_params)); |
| - if (delegate_) |
| - delegate_->DidAttach(); |
| + if (delegate_) { |
| + delegate_->DidAttach(extra_params); |
| + // TODO(lazyboy): Should not set this if src is empty. |
| + has_render_view_ = true; |
|
Fady Samuel
2014/05/27 14:19:06
This flag only makes sense for a new window with a
lazyboy
2014/05/27 20:43:00
So what change is required to get that info here t
|
| + } |
| } |
| BrowserPluginGuest::~BrowserPluginGuest() { |
| @@ -423,14 +422,17 @@ ColorChooser* BrowserPluginGuest::OpenColorChooser( |
| } |
| bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) { |
| + printf("+++ %s\n", __PRETTY_FUNCTION__); |
| if (delegate_) { |
| WebContentsViewGuest* view_guest = |
| static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
| ContextMenuParams context_menu_params = |
| view_guest->ConvertContextMenuParams(params); |
| + printf("To delegate_\n"); |
| return delegate_->HandleContextMenu(context_menu_params); |
| } |
| + printf("To WebContentsViewGuest\n"); |
| // Will be handled by WebContentsViewGuest. |
| return false; |
| @@ -707,11 +709,6 @@ void BrowserPluginGuest::Attach( |
| if (attached()) |
| return; |
| - // Clear parameters that get inherited from the opener. |
| - params.storage_partition_id.clear(); |
| - params.persist_storage = false; |
| - params.src.clear(); |
| - |
| // If a RenderView has already been created for this new window, then we need |
| // to initialize the browser-side state now so that the RenderFrameHostManager |
| // does not create a new RenderView on navigation. |
| @@ -723,7 +720,7 @@ void BrowserPluginGuest::Attach( |
| new_view->CreateViewForWidget(web_contents()->GetRenderViewHost()); |
| } |
| - Initialize(params, embedder_web_contents); |
| + Initialize(params, embedder_web_contents, extra_params); |
| SendQueuedMessages(); |