Commit 08f2f6a4 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

PreviewTab: Do not handle back button if suppressed

This CL changes the bottom sheet behavior so that Preview Tab in
suppressed state does not consume back button.

Bug: 1065286
Change-Id: I620fc3c74877e5af3096a635d9cb2f9c82def66f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2125908Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754714}
parent 5cf20ded
...@@ -411,7 +411,9 @@ public class BottomSheetController implements Destroyable { ...@@ -411,7 +411,9 @@ public class BottomSheetController implements Destroyable {
* @return {@code true} if the sheet or content handled the back press. * @return {@code true} if the sheet or content handled the back press.
*/ */
public boolean handleBackPress() { public boolean handleBackPress() {
if (mBottomSheet == null) return false; // If suppressed (therefore invisible), users are likely to expect for Chrome
// browser, not the bottom sheet, to react. Do not consume the event.
if (mBottomSheet == null || mIsSuppressed) return false;
// Give the sheet the opportunity to handle the back press itself before falling to the // Give the sheet the opportunity to handle the back press itself before falling to the
// default "close" behavior. // default "close" behavior.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment