Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java |
| index 55db785f021036a1f4cb2eccd50ed96d9df770f2..aea8eb786e59e8c2e141e7d3a3a86c3b70098893 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java |
| @@ -5,6 +5,8 @@ |
| package org.chromium.chrome.browser.compositor.bottombar; |
| import android.text.TextUtils; |
| +import android.view.View; |
| +import android.view.ViewGroup; |
| import org.chromium.base.VisibleForTesting; |
| import org.chromium.base.annotations.CalledByNative; |
| @@ -22,6 +24,7 @@ import org.chromium.content.browser.ContentViewCore; |
| import org.chromium.content_public.browser.LoadUrlParams; |
| import org.chromium.content_public.browser.WebContents; |
| import org.chromium.content_public.browser.WebContentsObserver; |
| +import org.chromium.ui.base.ViewAndroidDelegate; |
| /** |
| * Content container for an OverlayPanel. This class is responsible for the management of the |
| @@ -229,7 +232,30 @@ public class OverlayPanelContent { |
| // Creates an initially hidden WebContents which gets shown when the panel is opened. |
| WebContents panelWebContents = WebContentsFactory.createWebContents(false, true); |
| - mContentViewCore.initialize(cv, cv, panelWebContents, mActivity.getWindowAndroid()); |
| + |
| + // Dummny ViewAndroidDelegate since the container view for overlay panel is |
| + // never added to the view hierarchy. |
| + ViewAndroidDelegate delegate = new ViewAndroidDelegate() { |
| + @Override |
| + public View acquireView() { |
| + return null; |
|
Ted C
2016/07/27 20:10:47
should we add an assert to this (and potentially g
Jinsuk Kim
2016/07/29 06:09:13
Done.
|
| + } |
| + |
| + @Override |
| + public void setViewPosition(View anchorView, float x, float y, |
| + float width, float height, float scale, int leftMargin, int topMargin) { } |
| + |
| + @Override |
| + public void removeView(View anchorView) { } |
| + |
| + @Override |
| + public ViewGroup getContainerView() { |
| + return null; |
| + } |
| + |
| + }; |
| + mContentViewCore.initialize(cv, delegate, cv, panelWebContents, |
| + mActivity.getWindowAndroid()); |
| // Transfers the ownership of the WebContents to the native OverlayPanelContent. |
| nativeSetWebContents(mNativeOverlayPanelContentPtr, panelWebContents, mWebContentsDelegate); |