Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 444813002: Remove BrowserPlugin's -internal-attach method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4c754ffab6b20e7b3dda2a5a6e63d07020b9f0a7..062f5784ca88df76a424ae22c046d427ac07457e 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),
@@ -163,9 +162,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;
@@ -204,16 +203,13 @@ void BrowserPluginGuest::Initialize(
embedder_web_contents_observer_.reset(new EmbedderWebContentsObserver(this));
- OnResizeGuest(instance_id_, params.resize_guest_params);
+ OnResizeGuest(guest_instance_id_, 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));
// TODO(chrishtr): this code is wrong. The navigate_on_drag_drop field will
// be reset again the next time preferences are updated.
@@ -231,7 +227,10 @@ void BrowserPluginGuest::Initialize(
}
// Inform the embedder of the guest's attachment.
- SendMessageToEmbedder(new BrowserPluginMsg_Attach_ACK(instance_id_));
+ SendMessageToEmbedder(new BrowserPluginMsg_Attach_ACK(guest_instance_id_));
+
+ SendMessageToEmbedder(new BrowserPluginMsg_GuestContentWindowReady(
+ guest_instance_id_, guest_routing_id));
}
BrowserPluginGuest::~BrowserPluginGuest() {
@@ -265,7 +264,7 @@ RenderWidgetHostView* BrowserPluginGuest::GetEmbedderRenderWidgetHostView() {
}
void BrowserPluginGuest::UpdateVisibility() {
- OnSetVisibility(instance_id_, visible());
+ OnSetVisibility(guest_instance_id_, visible());
}
void BrowserPluginGuest::CopyFromCompositingSurface(
@@ -375,7 +374,7 @@ void BrowserPluginGuest::RenderViewReady() {
Send(new InputMsg_SetFocus(routing_id(), focused_));
UpdateVisibility();
- OnSetContentsOpaque(instance_id_, guest_opaque_);
+ OnSetContentsOpaque(guest_instance_id_, guest_opaque_);
RenderWidgetHostImpl::From(rvh)->set_hung_renderer_delay_ms(
base::TimeDelta::FromMilliseconds(kHungRendererDelayMs));
@@ -458,14 +457,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
@@ -478,7 +477,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();

Powered by Google App Engine
This is Rietveld 408576698