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

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

Issue 2097623003: Close the panel if show has been requested (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 b2b8d598c6f48b7252f3de23d789c67fdc813f07..6c47e6bb486f615b09a76b1cbc7ffd5a463b4533 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
@@ -121,6 +121,9 @@ public class OverlayPanel extends OverlayPanelAnimation implements ActivityState
/** If the panel should be ignoring swipe events (for compatibility mode). */
private boolean mIgnoreSwipeEvents;
+ /** This is used to make sure there is one show request to one close request. */
+ private boolean mPanelShowRequested;
+
// ============================================================================================
// Constructor
// ============================================================================================
@@ -184,7 +187,9 @@ public class OverlayPanel extends OverlayPanelAnimation implements ActivityState
@Override
public void closePanel(StateChangeReason reason, boolean animate) {
- if (!isShowing()) return;
+ // If the panel hasn't peeked, then it shouldn't need to close.
+ if (!mPanelShowRequested) return;
+ mPanelShowRequested = false;
super.closePanel(reason, animate);
}
@@ -194,7 +199,8 @@ public class OverlayPanel extends OverlayPanelAnimation implements ActivityState
* @param reason The reason the panel is being shown.
*/
public void requestPanelShow(StateChangeReason reason) {
- if (isShowing()) return;
+ if (mPanelShowRequested) return;
+ mPanelShowRequested = true;
if (mPanelManager != null) {
mPanelManager.requestPanelShow(this, reason);
« 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