Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanel.java

Issue 1532793003: Use correct width for narrow panel in Reader Mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 99e3218229e94d25b359dcd7a2c8970e581d86db..6913308b12a6b02dabefa4f88ec2eeb1feea5106 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
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.compositor.bottombar;
import android.app.Activity;
import android.content.Context;
+import android.view.View.MeasureSpec;
import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationStatus;
@@ -17,6 +18,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;
@@ -308,12 +310,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;
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698