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

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

Issue 2064163003: Press back when floating popup is active backgrounds chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added back RecordUserAction 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 | chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java » ('j') | 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/ChromeActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
index aa4ed4d5627730b5ea879a3e6683882f36156014..4f4665d09c46987c491d5701f166c0bf74724bfc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -1427,28 +1427,30 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
@Override
public final void onBackPressed() {
+ RecordUserAction.record("SystemBack");
if (mCompositorViewHolder != null) {
LayoutManager layoutManager = mCompositorViewHolder.getLayoutManager();
- boolean layoutConsumed = layoutManager != null && layoutManager.onBackPressed();
- if (layoutConsumed || mContextualSearchManager != null
- && mContextualSearchManager.onBackPressed()) {
- RecordUserAction.record("SystemBack");
- return;
- }
+ if (layoutManager != null && layoutManager.onBackPressed()) return;
}
- if (!isSelectActionBarShowing() && handleBackPressed()) {
+
+ ContentViewCore contentViewCore = getContentViewCore();
+ if (contentViewCore != null && contentViewCore.isSelectActionBarShowing()) {
+ contentViewCore.clearSelection();
return;
}
- // This will close the select action bar if it is showing, otherwise close the activity.
+
+ if (mContextualSearchManager != null && mContextualSearchManager.onBackPressed()) return;
gone 2016/06/14 23:30:10 Why'd you pull this logic out? Before, mContextua
amaralp 2016/06/14 23:50:12 I thought that the check wouldn't be necessary and
gone 2016/06/15 00:29:18 Hokay. So after lots and lots of archaeology, we
+
+ if (handleBackPressed()) return;
+
super.onBackPressed();
}
- private boolean isSelectActionBarShowing() {
+
+ private ContentViewCore getContentViewCore() {
Tab tab = getActivityTab();
- if (tab == null) return false;
- ContentViewCore contentViewCore = tab.getContentViewCore();
- if (contentViewCore == null) return false;
- return contentViewCore.isSelectActionBarShowing();
+ if (tab == null) return null;
+ return tab.getContentViewCore();
}
@Override
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698