Skip to content

Commit

Permalink
[Home] Do not intercept back button if in fullscreen mode
Browse files Browse the repository at this point in the history
While in fullscreen mode, the bottom sheet should not intercept the
back button; exiting fullscreen should take priority. This change
moves the fullscreen check in ChromeTabbedActivity so that it is handled
before the bottom sheet has a chance to intercept it.

BUG=762481

Change-Id: I1def229ae8329b3028a7e9fe37b803ef3d1a3bf4
Reviewed-on: https://chromium-review.googlesource.com/653178
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500111}
  • Loading branch information
iotitan authored and Commit Bot committed Sep 6, 2017
1 parent 15bab7e commit 7b0b4c4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,11 @@ public boolean handleBackPressed() {
if (!mUIInitialized) return false;
final Tab currentTab = getActivityTab();

if (exitFullscreenIfShowing()) {
recordBackPressedUma("Exited fullscreen", BACK_PRESSED_EXITED_FULLSCREEN);
return true;
}

if (getBottomSheet() != null && getBottomSheet().handleBackPress()) return true;

if (currentTab == null) {
Expand All @@ -1717,11 +1722,6 @@ public boolean handleBackPressed() {
return true;
}

if (exitFullscreenIfShowing()) {
recordBackPressedUma("Exited fullscreen", BACK_PRESSED_EXITED_FULLSCREEN);
return true;
}

if (getToolbarManager().back()) {
recordBackPressedUma("Navigating backward", BACK_PRESSED_NAVIGATED_BACK);
return true;
Expand Down

0 comments on commit 7b0b4c4

Please sign in to comment.