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

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

Issue 2514143002: [TTS][Overlay] Fix content width overflowing narrow panel. (Closed)
Patch Set: Created 4 years, 1 month 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 | no next file » | 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 d202dbffbe05f6b86e1c8dffb1548cdfefa197f2..403fbeaca43176e7e382eb3502e72feec78448f8 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
@@ -122,6 +122,9 @@ public class OverlayPanel extends OverlayPanelAnimation implements ActivityState
/** This is used to make sure there is one show request to one close request. */
private boolean mPanelShown;
+ /** Cache the viewport height of the screen to filter SceneOverlay#onSizeChanged events. */
+ private float mViewportHeight;
+
// ============================================================================================
// Constructor
// ============================================================================================
@@ -791,8 +794,14 @@ public class OverlayPanel extends OverlayPanelAnimation implements ActivityState
@Override
public void onSizeChanged(float width, float height, float visibleViewportOffsetY,
int orientation) {
- resizePanelContentViewCore(width, height);
- onLayoutChanged(width, height, visibleViewportOffsetY);
+ // Filter events that don't change the viewport height.
+ if (height != mViewportHeight) {
+ // We only care if the orientation is changing, which will certainly change the screen's
+ // viewport height.
+ mViewportHeight = height;
+ resizePanelContentViewCore(width, height);
+ onLayoutChanged(width, height, visibleViewportOffsetY);
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698