Tab Strip WebUI: Add options to test MRU/auto-close behavior
This CL adds temporary checkboxes to the bottom right of the tab strip
to allow for easy testing of 4 modes:
1) Most Recently Used ordering with auto-closing tab strip
2) Most Recently Used ordering when tab strip is closed manually
3) Default ordering with auto-closing tab strip
4) Default ordering with no auto-closing tab strip
This CL also brings back drag-and-drop for unpinned tabs for cases where
MRU is disabled.
Bug: 989131, 1005554, 1005565
Change-Id: Iae066c2d85da712ecae29c040468cf67b31fd0d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867477
Commit-Queue: John Lee <[email protected]>
Reviewed-by: Demetrios Papadopoulos <[email protected]>
Cr-Commit-Position: refs/heads/master@{#708018}
diff --git a/chrome/browser/resources/tab_strip/tab.js b/chrome/browser/resources/tab_strip/tab.js
index 956a229..a9e4bc0 100644
--- a/chrome/browser/resources/tab_strip/tab.js
+++ b/chrome/browser/resources/tab_strip/tab.js
@@ -8,6 +8,7 @@
import {AlertIndicatorsElement} from './alert_indicators.js';
import {CustomElement} from './custom_element.js';
import {TabStripEmbedderProxy} from './tab_strip_embedder_proxy.js';
+import {tabStripOptions} from './tab_strip_options.js';
import {TabData, TabNetworkState, TabsApiProxy} from './tabs_api_proxy.js';
export const DEFAULT_ANIMATION_DURATION = 125;
@@ -87,7 +88,7 @@
tab.networkState === TabNetworkState.LOADING);
this.toggleAttribute('pinned', tab.pinned);
this.toggleAttribute('blocked_', tab.blocked);
- this.setAttribute('draggable', tab.pinned);
+ this.setAttribute('draggable', true);
this.toggleAttribute('crashed_', tab.crashed);
if (!this.tab_ || this.tab_.title !== tab.title) {
@@ -140,7 +141,10 @@
}
this.tabsApi_.activateTab(this.tab_.id);
- this.embedderApi_.closeContainer();
+
+ if (tabStripOptions.autoCloseEnabled) {
+ this.embedderApi_.closeContainer();
+ }
}
/** @private */