Remove initial size from WebContentsView::CreateView()
The size is not used intentionally because it can be wrong, but is
plumbed around by everyone anyways. The only consumer is for browser
plugin. Since the size is updated shortly after (that's why it is ok
to ignore says the comment in WebContentsViewAura) we don't need all
these setters and plumbings just for WebContentsViewGuest.
[email protected]
TBR=halliwell
Bug: 998273
Change-Id: I5e783a3469a36f108766cdd256e629039dadc2f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1790483
Commit-Queue: danakj <[email protected]>
Reviewed-by: Luke Halliwell <[email protected]>
Reviewed-by: Bo <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Andrey Kosyakov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#696095}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 72043cf..ca4ee9d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1945,7 +1945,7 @@
view_.reset(CreateWebContentsView(
this, GetContentClient()->browser()->GetWebContentsViewDelegate(this),
&render_view_host_delegate_view_));
- view_->CreateView(GetPreferredSize(), nullptr);
+ view_->CreateView(nullptr);
std::unique_ptr<WebContents> web_contents =
node_.DisconnectFromOuterWebContents();
DCHECK_EQ(web_contents.get(), this);
@@ -2040,7 +2040,6 @@
// We pass our own opener so that the cloned page can access it if it was set
// before.
CreateParams create_params(GetBrowserContext(), GetSiteInstance());
- create_params.initial_size = GetContainerBounds().size();
FrameTreeNode* opener = frame_tree_.root()->opener();
RenderFrameHostImpl* opener_rfh = nullptr;
if (opener)
@@ -2155,8 +2154,7 @@
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
- gfx::Size initial_size = params.initial_size;
- view_->CreateView(initial_size, params.context);
+ view_->CreateView(params.context);
#if BUILDFLAG(ENABLE_PLUGINS)
plugin_content_origin_whitelist_.reset(
@@ -2874,7 +2872,6 @@
std::unique_ptr<WebContents> new_contents;
if (!is_guest) {
create_params.context = view_->GetNativeView();
- create_params.initial_size = GetContainerBounds().size();
new_contents = WebContents::Create(create_params);
} else {
new_contents = base::WrapUnique(