Update common/chromium/web_contents.patch

This commit is contained in:
Aleksei Kuzmin 2018-03-27 17:35:19 +03:00
Родитель 23f9905234
Коммит 3461fdca80
1 изменённых файлов: 30 добавлений и 23 удалений

Просмотреть файл

@ -1,8 +1,8 @@
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index cf3733f..065df39 100644
index 018534073da1..48f3d0e7343b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1581,6 +1581,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -1759,6 +1759,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
@ -15,19 +15,19 @@ index cf3733f..065df39 100644
WebContentsViewDelegate* delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -1591,6 +1597,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
view_.reset(CreateWebContentsView(this, delegate,
&render_view_host_delegate_view_));
@@ -1774,6 +1780,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
&render_view_host_delegate_view_);
}
}
+ } // !view_
+ } // !view_
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
if (browser_plugin_guest_ && !GuestMode::IsCrossProcessFrameGuest(this)) {
view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
diff --git a/content/browser/web_contents/web_contents_view_guest.cc b/content/browser/web_contents/web_contents_view_guest.cc
index a93bc37..70f2f3b 100644
index 699570cc1390..454830098cb9 100644
--- a/content/browser/web_contents/web_contents_view_guest.cc
+++ b/content/browser/web_contents/web_contents_view_guest.cc
@@ -72,17 +72,23 @@ void WebContentsViewGuest::GetScreenInfo(ScreenInfo* screen_info) const {
@@ -67,21 +67,27 @@ gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
#if defined(USE_AURA)
@ -38,8 +38,10 @@ index a93bc37..70f2f3b 100644
// view hierarchy. We add this view as embedder's child here.
// This would go in WebContentsViewGuest::CreateView, but that is too early to
// access embedder_web_contents(). Therefore, we do it here.
+ if (parent_view->GetNativeView() != platform_view_->GetNativeView())
parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
if (!base::FeatureList::IsEnabled(features::kMash))
- parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
+ if (parent_view->GetNativeView() != platform_view_->GetNativeView())
+ parent_view->GetNativeView()->AddChild(platform_view_->GetNativeView());
#endif // defined(USE_AURA)
}
@ -47,10 +49,15 @@ index a93bc37..70f2f3b 100644
#if defined(USE_AURA)
+ if (!platform_view_->GetNativeView())
+ return;
+ if (old_parent_view->GetNativeView() != platform_view_->GetNativeView())
old_parent_view->GetNativeView()->RemoveChild(
platform_view_->GetNativeView());
if (!base::FeatureList::IsEnabled(features::kMash)) {
- old_parent_view->GetNativeView()->RemoveChild(
- platform_view_->GetNativeView());
+ if (old_parent_view->GetNativeView() != platform_view_->GetNativeView())
+ old_parent_view->GetNativeView()->RemoveChild(
+ platform_view_->GetNativeView());
}
#endif // defined(USE_AURA)
}
@@ -146,11 +152,22 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
render_widget_host->GetView());
}
@ -79,11 +86,11 @@ index a93bc37..70f2f3b 100644
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForPopupWidget(
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 453942537f6c..6055b966ccee 100644
index a13db5f4dd61..621124decfdc 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -68,9 +68,12 @@ class InterstitialPage;
class PageState;
@@ -69,9 +69,12 @@ class BrowserPluginGuestDelegate;
class InterstitialPage;
class RenderFrameHost;
class RenderViewHost;
+class RenderViewHostDelegateView;
@ -95,14 +102,14 @@ index 453942537f6c..6055b966ccee 100644
struct CustomContextMenuContext;
struct DropData;
struct Manifest;
@@ -163,6 +166,10 @@ class WebContents : public PageNavigator,
// Note that the pre-created renderer process may not be used if the first
@@ -172,6 +175,10 @@ class WebContents : public PageNavigator,
// navigation requires a dedicated or privileged process, such as a WebUI.
bool initialize_renderer;
+
+ // Optionally specify the view and delegate view.
+ content::WebContentsView* view = nullptr;
+ content::RenderViewHostDelegateView* delegate_view = nullptr;
+
// Sandboxing flags set on the new WebContents.
blink::WebSandboxFlags starting_sandbox_flags;
};
// Creates a new WebContents.