| Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java
|
| index beb8190efdcb592f8da4bd3f92b2740f1f76ec9e..bc827b466c9bed4024aed7c3c0a9b52c37f93b9e 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java
|
| @@ -5,6 +5,7 @@
|
| package org.chromium.chrome.browser.compositor.bottombar;
|
|
|
| import android.content.Context;
|
| +import android.view.View.MeasureSpec;
|
|
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.chrome.browser.ChromeActivity;
|
| @@ -13,6 +14,7 @@ import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.Context
|
| import org.chromium.chrome.browser.compositor.layouts.LayoutUpdateHost;
|
| import org.chromium.chrome.browser.compositor.scene_layer.SceneLayer;
|
| import org.chromium.chrome.browser.tab.Tab;
|
| +import org.chromium.content.browser.ContentViewClient;
|
| import org.chromium.content.browser.ContentViewCore;
|
| import org.chromium.content_public.common.TopControlsState;
|
| import org.chromium.ui.base.LocalizationUtils;
|
| @@ -280,12 +282,36 @@ public class OverlayPanel extends ContextualSearchPanelAnimation
|
| }
|
|
|
| /**
|
| + * Add any other objects that depend on the OverlayPanelContent having already been created.
|
| + */
|
| + private OverlayPanelContent createNewOverlayPanelContentInternal() {
|
| + OverlayPanelContent content = mContentFactory.createNewOverlayPanelContent();
|
| + // Adds a ContentViewClient to override the default fullscreen size.
|
| + content.setContentViewClient(new ContentViewClient() {
|
| + @Override
|
| + public int getDesiredWidthMeasureSpec() {
|
| + return MeasureSpec.makeMeasureSpec(
|
| + getSearchContentViewWidthPx(),
|
| + MeasureSpec.EXACTLY);
|
| + }
|
| +
|
| + @Override
|
| + public int getDesiredHeightMeasureSpec() {
|
| + return MeasureSpec.makeMeasureSpec(
|
| + getSearchContentViewHeightPx(),
|
| + MeasureSpec.EXACTLY);
|
| + }
|
| + });
|
| + return content;
|
| + }
|
| +
|
| + /**
|
| * @return A new OverlayPanelContent if the instance was null or the existing one.
|
| */
|
| protected OverlayPanelContent getOverlayPanelContent() {
|
| // Only create the content when necessary
|
| if (mContent == null) {
|
| - mContent = mContentFactory.createNewOverlayPanelContent();
|
| + mContent = createNewOverlayPanelContentInternal();
|
| }
|
| return mContent;
|
| }
|
|
|