| Index: content/browser/web_contents/web_contents_view_android.cc
|
| diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
|
| index 0222bc629b44766fe282fe8df395257522a925a6..4a7afa442638b46c723ab60165c1724aec7c5a8f 100644
|
| --- a/content/browser/web_contents/web_contents_view_android.cc
|
| +++ b/content/browser/web_contents/web_contents_view_android.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/android/jni_android.h"
|
| #include "base/android/jni_string.h"
|
| #include "base/logging.h"
|
| +#include "cc/layers/layer.h"
|
| #include "content/browser/android/content_view_core_impl.h"
|
| #include "content/browser/frame_host/interstitial_page_impl.h"
|
| #include "content/browser/renderer_host/render_widget_host_view_android.h"
|
| @@ -64,6 +65,8 @@ WebContentsViewAndroid::WebContentsViewAndroid(
|
| }
|
|
|
| WebContentsViewAndroid::~WebContentsViewAndroid() {
|
| + if (view_ && view_->GetLayer())
|
| + view_->GetLayer()->RemoveFromParent();
|
| }
|
|
|
| void WebContentsViewAndroid::SetContentViewCore(
|
| @@ -87,7 +90,7 @@ void WebContentsViewAndroid::SetContentViewCore(
|
| }
|
|
|
| gfx::NativeView WebContentsViewAndroid::GetNativeView() const {
|
| - return content_view_core_ ? content_view_core_->GetViewAndroid() : nullptr;
|
| + return view_.get();
|
| }
|
|
|
| gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const {
|
| @@ -161,6 +164,11 @@ gfx::Rect WebContentsViewAndroid::GetViewBounds() const {
|
|
|
| void WebContentsViewAndroid::CreateView(
|
| const gfx::Size& initial_size, gfx::NativeView context) {
|
| + // On Android, avoid using the native view copied over from the CreateParams
|
| + // of the existing web contents view where initial size and the view are
|
| + // already set. Embedder provides one associated with a Java layer
|
| + // content view and the delegate.
|
| + if (initial_size.IsEmpty() && context) view_.reset(context);
|
| }
|
|
|
| RenderWidgetHostViewBase* WebContentsViewAndroid::CreateViewForWidget(
|
|
|