| 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 ef729e4b0596498a9955642a94894392af461e54..b46cde3882a6c9d75664a0aec1ffc0c2c20b09f6 100644
|
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc
|
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| @@ -65,14 +65,13 @@ class BrowserPluginGuest::EmbedderWebContentsObserver
|
| DISALLOW_COPY_AND_ASSIGN(EmbedderWebContentsObserver);
|
| };
|
|
|
| -BrowserPluginGuest::BrowserPluginGuest(
|
| - int instance_id,
|
| - bool has_render_view,
|
| - WebContentsImpl* web_contents,
|
| - BrowserPluginGuestDelegate* delegate)
|
| +BrowserPluginGuest::BrowserPluginGuest(int guest_instance_id,
|
| + bool has_render_view,
|
| + WebContentsImpl* web_contents,
|
| + BrowserPluginGuestDelegate* delegate)
|
| : WebContentsObserver(web_contents),
|
| embedder_web_contents_(NULL),
|
| - instance_id_(instance_id),
|
| + guest_instance_id_(guest_instance_id),
|
| guest_device_scale_factor_(1.0f),
|
| focused_(false),
|
| mouse_locked_(false),
|
| @@ -166,9 +165,9 @@ bool BrowserPluginGuest::OnMessageReceivedFromEmbedder(
|
| }
|
|
|
| void BrowserPluginGuest::Initialize(
|
| + int browser_plugin_instance_id,
|
| const BrowserPluginHostMsg_Attach_Params& params,
|
| - WebContentsImpl* embedder_web_contents,
|
| - const base::DictionaryValue& extra_params) {
|
| + WebContentsImpl* embedder_web_contents) {
|
| focused_ = params.focused;
|
| guest_visible_ = params.visible;
|
| guest_opaque_ = params.opaque;
|
| @@ -212,16 +211,13 @@ void BrowserPluginGuest::Initialize(
|
| embedder_web_contents_observer_.reset(new EmbedderWebContentsObserver(this));
|
|
|
| OnSetAutoSize(
|
| - instance_id_, params.auto_size_params, params.resize_guest_params);
|
| + guest_instance_id_, params.auto_size_params, params.resize_guest_params);
|
|
|
| // Create a swapped out RenderView for the guest in the embedder render
|
| // process, so that the embedder can access the guest's window object.
|
| int guest_routing_id =
|
| GetWebContents()->CreateSwappedOutRenderView(
|
| embedder_web_contents_->GetSiteInstance());
|
| - SendMessageToEmbedder(
|
| - new BrowserPluginMsg_GuestContentWindowReady(instance_id_,
|
| - guest_routing_id));
|
|
|
| WebPreferences prefs = GetWebContents()->GetWebkitPrefs();
|
| prefs.navigate_on_drag_drop = false;
|
| @@ -236,7 +232,11 @@ void BrowserPluginGuest::Initialize(
|
| }
|
|
|
| // Inform the embedder of the guest's attachment.
|
| - SendMessageToEmbedder(new BrowserPluginMsg_Attach_ACK(instance_id_));
|
| + SendMessageToEmbedder(new BrowserPluginMsg_Attach_ACK(
|
| + browser_plugin_instance_id, guest_instance_id_));
|
| +
|
| + SendMessageToEmbedder(new BrowserPluginMsg_GuestContentWindowReady(
|
| + guest_instance_id_, guest_routing_id));
|
| }
|
|
|
| BrowserPluginGuest::~BrowserPluginGuest() {
|
| @@ -270,7 +270,7 @@ RenderWidgetHostView* BrowserPluginGuest::GetEmbedderRenderWidgetHostView() {
|
| }
|
|
|
| void BrowserPluginGuest::UpdateVisibility() {
|
| - OnSetVisibility(instance_id_, visible());
|
| + OnSetVisibility(guest_instance_id_, visible());
|
| }
|
|
|
| void BrowserPluginGuest::CopyFromCompositingSurface(
|
| @@ -389,7 +389,7 @@ void BrowserPluginGuest::RenderViewReady() {
|
| else
|
| rvh->DisableAutoResize(full_size_);
|
|
|
| - OnSetContentsOpaque(instance_id_, guest_opaque_);
|
| + OnSetContentsOpaque(guest_instance_id_, guest_opaque_);
|
|
|
| RenderWidgetHostImpl::From(rvh)->set_hung_renderer_delay_ms(
|
| base::TimeDelta::FromMilliseconds(kHungRendererDelayMs));
|
| @@ -473,14 +473,14 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) {
|
| }
|
|
|
| void BrowserPluginGuest::Attach(
|
| + int browser_plugin_instance_id,
|
| WebContentsImpl* embedder_web_contents,
|
| - const BrowserPluginHostMsg_Attach_Params& params,
|
| - const base::DictionaryValue& extra_params) {
|
| + const BrowserPluginHostMsg_Attach_Params& params) {
|
| if (attached())
|
| return;
|
|
|
| if (delegate_)
|
| - delegate_->WillAttach(embedder_web_contents, extra_params);
|
| + delegate_->WillAttach(embedder_web_contents);
|
|
|
| // 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
|
| @@ -493,7 +493,7 @@ void BrowserPluginGuest::Attach(
|
| new_view->CreateViewForWidget(web_contents()->GetRenderViewHost());
|
| }
|
|
|
| - Initialize(params, embedder_web_contents, extra_params);
|
| + Initialize(browser_plugin_instance_id, params, embedder_web_contents);
|
|
|
| SendQueuedMessages();
|
|
|
| @@ -750,7 +750,7 @@ void BrowserPluginGuest::OnSetAutoSize(
|
| GetWebContents()->GetRenderViewHost()->DisableAutoResize(
|
| resize_guest_params.view_size);
|
| }
|
| - OnResizeGuest(instance_id_, resize_guest_params);
|
| + OnResizeGuest(guest_instance_id_, resize_guest_params);
|
| }
|
|
|
| void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent(
|
|
|