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

Unified Diff: extensions/browser/guest_view/guest_view_base.cc

Issue 910073003: <webview>: Make contentWindow available prior to attachment (on display:none). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use constants Created 5 years, 10 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: extensions/browser/guest_view/guest_view_base.cc
diff --git a/extensions/browser/guest_view/guest_view_base.cc b/extensions/browser/guest_view/guest_view_base.cc
index b7bf687b7a249cc485d3a647f398889c1075f0de..913dc4ec46bfe250dfd8a61b30203cb613a2b2e4 100644
--- a/extensions/browser/guest_view/guest_view_base.cc
+++ b/extensions/browser/guest_view/guest_view_base.cc
@@ -153,7 +153,7 @@ GuestViewBase::GuestViewBase(content::WebContents* owner_web_contents)
element_instance_id_(guestview::kInstanceIDNone),
initialized_(false),
is_being_destroyed_(false),
- guest_sizer_(nullptr),
+ guest_proxy_host_(nullptr),
auto_size_enabled_(false),
is_full_page_plugin_(false),
weak_ptr_factory_(this) {
@@ -291,7 +291,7 @@ void GuestViewBase::SetSize(const SetSizeParams& params) {
GuestSizeChangedDueToAutoSize(guest_size_, new_size);
} else {
// Autosize was already disabled.
- guest_sizer_->SizeContents(new_size);
+ guest_proxy_host_->SizeContents(new_size);
}
DispatchOnResizeEvent(guest_size_, new_size);
@@ -378,7 +378,7 @@ content::WebContents* GuestViewBase::CreateNewGuestWindow(
create_params);
}
-void GuestViewBase::DidAttach(int guest_proxy_routing_id) {
+void GuestViewBase::DidAttach() {
opener_lifetime_observer_.reset();
SetUpSizing(*attach_params());
@@ -389,7 +389,7 @@ void GuestViewBase::DidAttach(int guest_proxy_routing_id) {
// Inform the associated GuestViewContainer that the contentWindow is ready.
embedder_web_contents()->Send(new GuestViewMsg_GuestAttached(
element_instance_id_,
- guest_proxy_routing_id));
+ guest_proxy_host_->GetOrCreateGuestProxyInOwnerProcess()));
SendQueuedEvents();
}
@@ -424,7 +424,7 @@ void GuestViewBase::Destroy() {
is_being_destroyed_ = true;
- guest_sizer_ = nullptr;
+ guest_proxy_host_ = nullptr;
// It is important to clear owner_web_contents_ after the call to
// StopTrackingEmbedderZoomLevel(), but before the rest of
@@ -443,8 +443,7 @@ void GuestViewBase::Destroy() {
weak_ptr_factory_.InvalidateWeakPtrs();
// Give the content module an opportunity to perform some cleanup.
- if (!destruction_callback_.is_null())
- destruction_callback_.Run();
+ guest_proxy_host_->WillDestroy();
webcontents_guestview_map.Get().erase(web_contents());
GuestViewManager::FromBrowserContext(browser_context_)->
@@ -471,13 +470,9 @@ void GuestViewBase::SetOpener(GuestViewBase* guest) {
opener_lifetime_observer_.reset();
}
-void GuestViewBase::RegisterDestructionCallback(
- const DestructionCallback& callback) {
- destruction_callback_ = callback;
-}
-
-void GuestViewBase::SetGuestSizer(content::GuestSizer* guest_sizer) {
- guest_sizer_ = guest_sizer;
+void GuestViewBase::SetGuestProxyHost(
+ content::GuestProxyHost* guest_proxy_host) {
+ guest_proxy_host_ = guest_proxy_host;
}
void GuestViewBase::WillAttach(content::WebContents* embedder_web_contents,

Powered by Google App Engine
This is Rietveld 408576698