#789 fix non-responsive buttons
This commit is contained in:
@@ -11,8 +11,9 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
.../java/res/xml/privacy_preferences.xml | 7 ++++
|
||||
.../flags/cromite/sTabSwitcherListMode.java | 33 +++++++++++++++++++
|
||||
.../Use-list-mode-for-tab-switcher.grdp | 9 +++++
|
||||
.../browser/toolbar/top/ToolbarPhone.java | 15 ++++++---
|
||||
.../tab-switcher-list-mode.inc | 3 ++
|
||||
5 files changed, 54 insertions(+), 2 deletions(-)
|
||||
6 files changed, 64 insertions(+), 7 deletions(-)
|
||||
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sTabSwitcherListMode.java
|
||||
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Use-list-mode-for-tab-switcher.grdp
|
||||
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/tab-switcher-list-mode.inc
|
||||
@@ -107,6 +108,65 @@ new file mode 100644
|
||||
+ Activates the list view of tabs in the tab switcher
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
|
||||
@@ -53,6 +53,7 @@ import org.chromium.base.TraceEvent;
|
||||
import org.chromium.base.supplier.ObservableSupplier;
|
||||
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
+import org.chromium.chrome.browser.flags.cromite.sTabSwitcherListMode;
|
||||
import org.chromium.chrome.browser.omnibox.LocationBar;
|
||||
import org.chromium.chrome.browser.omnibox.LocationBarCoordinator;
|
||||
import org.chromium.chrome.browser.omnibox.NewTabPageDelegate;
|
||||
@@ -519,7 +520,8 @@ public class ToolbarPhone extends ToolbarLayout
|
||||
|
||||
private void inflateTabSwitchingResources() {
|
||||
mToggleTabStackButton = findViewById(R.id.tab_switcher_button);
|
||||
- mToggleTabStackButton.setClickable(false);
|
||||
+ if (!sTabSwitcherListMode.getInstance().isEnabled())
|
||||
+ mToggleTabStackButton.setClickable(false);
|
||||
}
|
||||
|
||||
private void enableTabSwitchingResources() {
|
||||
@@ -2041,14 +2043,15 @@ public class ToolbarPhone extends ToolbarLayout
|
||||
// On entering the tab switcher, set the focusability of the url bar to be false. This will
|
||||
// occur at the start of the enter event, and will later be reset to true upon finishing the
|
||||
// exit event only in #onStartSurfaceStateChanged.
|
||||
- if (inTabSwitcherMode) {
|
||||
+ if (inTabSwitcherMode && !sTabSwitcherListMode.getInstance().isEnabled()) {
|
||||
mLocationBar.setUrlBarFocusable(false);
|
||||
}
|
||||
|
||||
// This method is only used for grid tab switcher with the start surface disabled. When
|
||||
// start surface is enabled, omnibox state is updated in onStartSurfaceStateChanged(), which
|
||||
// is always called before setTabSwitcherMode(), so skip here.
|
||||
- if (getToolbarDataProvider().shouldShowLocationBarInOverviewMode()) {
|
||||
+ if (getToolbarDataProvider().shouldShowLocationBarInOverviewMode()
|
||||
+ && !sTabSwitcherListMode.getInstance().isEnabled()) {
|
||||
// Prevent pressing the tab switcher button until after transition finishes.
|
||||
mToggleTabStackButton.setClickable(false);
|
||||
return;
|
||||
@@ -2068,7 +2071,8 @@ public class ToolbarPhone extends ToolbarLayout
|
||||
return;
|
||||
}
|
||||
// Prevent pressing the tab switcher button until after transition finishes.
|
||||
- mToggleTabStackButton.setClickable(false);
|
||||
+ if (!sTabSwitcherListMode.getInstance().isEnabled())
|
||||
+ mToggleTabStackButton.setClickable(false);
|
||||
|
||||
mTabSwitcherState = inTabSwitcherMode ? ENTERING_TAB_SWITCHER : EXITING_TAB_SWITCHER;
|
||||
|
||||
@@ -2162,7 +2166,8 @@ public class ToolbarPhone extends ToolbarLayout
|
||||
}
|
||||
if (mTabSwitcherState == ENTERING_TAB_SWITCHER) {
|
||||
mTabSwitcherState = TAB_SWITCHER;
|
||||
- mToggleTabStackButton.setClickable(false);
|
||||
+ if (!sTabSwitcherListMode.getInstance().isEnabled())
|
||||
+ mToggleTabStackButton.setClickable(false);
|
||||
}
|
||||
// Ensure clickable if in STATIC_TAB mode. This handles both when the state transitions
|
||||
// are ignored in favor of onStartSurfaceStateChanged() and when normal transitions occur.
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/tab-switcher-list-mode.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/tab-switcher-list-mode.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
|
||||
Reference in New Issue
Block a user