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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java

Issue 2896483003: [Home] Hide sheet when back pressed (Closed)
Patch Set: extra check Created 3 years, 7 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/omnibox/LocationBarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
index 04448c795e51b688addcdd84cfa237e07eacae72..c65062da38fe418251ad0b60f8f6207aa91d8a8b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
@@ -26,6 +26,7 @@ import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.toolbar.ToolbarDataProvider;
import org.chromium.chrome.browser.util.MathUtils;
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
+import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContentController;
import org.chromium.chrome.browser.widget.bottomsheet.EmptyBottomSheetObserver;
import org.chromium.ui.UiUtils;
@@ -357,4 +358,16 @@ public class LocationBarPhone extends LocationBarLayout {
}
});
}
+
+ @Override
+ public void backKeyPressed() {
+ super.backKeyPressed();
+
+ // If the back button was pressed while the placeholder content was showing, hide the sheet.
+ if (mBottomSheet != null && mBottomSheet.getCurrentSheetContent() != null
+ && mBottomSheet.getCurrentSheetContent().getType()
+ == BottomSheetContentController.TYPE_PLACEHOLDER) {
+ mBottomSheet.setSheetState(BottomSheet.SHEET_STATE_PEEK, true);
+ }
+ }
}
« 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