Skip to content

Commit a297577

Browse files
Ted ChocTed Choc
authored andcommitted
Fix showing app menu in multi-window when not the focused window.
In multi-window, the non-focused window will have the state of paused even though it is fully visible. So look for resumed only when in non-multi-window, but accept paused when in multi-window. This differs from MultiWindowUtils.isActivityVisible because that only mentions visibility, but I am aiming for visible and not occluded. BUG=845785,844787 Change-Id: Ifcca3784b899a4a19132b3b57efd5227dc2b3e90 Reviewed-on: https://chromium-review.googlesource.com/1076894 Reviewed-by: Theresa <[email protected]> Commit-Queue: Ted Choc <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#562587}(cherry picked from commit cdc84cb) Reviewed-on: https://chromium-review.googlesource.com/1081076 Reviewed-by: Ted Choc <[email protected]> Cr-Commit-Position: refs/branch-heads/3440@{#71} Cr-Branched-From: 010ddcf-refs/heads/master@{#561733}
1 parent e700daa commit a297577

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,12 @@ public boolean isInOverviewMode() {
14381438
public boolean shouldShowAppMenu() {
14391439
if (isActivityDestroyed()) return false;
14401440

1441-
if (ApplicationStatus.getStateForActivity(this) != ActivityState.RESUMED) return false;
1441+
@ActivityState
1442+
int state = ApplicationStatus.getStateForActivity(this);
1443+
boolean inMultiWindow = MultiWindowUtils.getInstance().isInMultiWindowMode(this);
1444+
if (state != ActivityState.RESUMED && (!inMultiWindow || state != ActivityState.PAUSED)) {
1445+
return false;
1446+
}
14421447

14431448
// Do not show the menu if Contextual Search panel is opened.
14441449
if (mContextualSearchManager != null && mContextualSearchManager.isSearchPanelOpened()) {

0 commit comments

Comments
 (0)