summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser_browsertest.cc9
-rw-r--r--chrome/browser/defaults.cc2
-rw-r--r--chrome/browser/defaults.h3
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc4
-rw-r--r--chrome/browser/tabs/tab_strip_model_unittest.cc4
5 files changed, 20 insertions, 2 deletions
diff --git a/chrome/browser/browser_browsertest.cc b/chrome/browser/browser_browsertest.cc
index 5371199..4d4773c 100644
--- a/chrome/browser/browser_browsertest.cc
+++ b/chrome/browser/browser_browsertest.cc
@@ -428,10 +428,16 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconChange) {
// TODO(sky): get these to run on a Mac.
#if !defined(OS_MACOSX)
IN_PROC_BROWSER_TEST_F(BrowserTest, PhantomTab) {
+ if (!browser_defaults::kPhantomTabsEnabled)
+ return;
+
PhantomTabTest();
}
IN_PROC_BROWSER_TEST_F(BrowserTest, RevivePhantomTab) {
+ if (!browser_defaults::kPhantomTabsEnabled)
+ return;
+
PhantomTabTest();
if (HasFatalFailure())
@@ -486,6 +492,9 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, TabClosingWhenRemovingExtension) {
}
IN_PROC_BROWSER_TEST_F(BrowserTest, AppTabRemovedWhenExtensionUninstalled) {
+ if (!browser_defaults::kPhantomTabsEnabled)
+ return;
+
PhantomTabTest();
Extension* extension = GetExtension();
diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc
index ecc23f4..35844a7 100644
--- a/chrome/browser/defaults.cc
+++ b/chrome/browser/defaults.cc
@@ -75,4 +75,6 @@ const bool kBrowserAliveWithNoWindows = true;
const bool kBrowserAliveWithNoWindows = false;
#endif
+const bool kPhantomTabsEnabled = false;
+
} // namespace browser_defaults
diff --git a/chrome/browser/defaults.h b/chrome/browser/defaults.h
index 4f98d8f..6414290 100644
--- a/chrome/browser/defaults.h
+++ b/chrome/browser/defaults.h
@@ -70,6 +70,9 @@ extern const bool kShowOtherBrowsersInAboutMemory;
// Should always open incognito windows when started with --incognito switch?
extern const bool kAlwaysOpenIncognitoWindow;
+// Are phantom tabs enabled?
+extern const bool kPhantomTabsEnabled;
+
} // namespace browser_defaults
#endif // CHROME_BROWSER_DEFAULTS_H_
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 7e0bcb7..7db00b0 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -1001,8 +1001,8 @@ int TabStripModel::IndexOfNextNonPhantomTab(int index,
}
bool TabStripModel::ShouldMakePhantomOnClose(int index) {
- if (IsTabPinned(index) && !IsPhantomTab(index) && !closing_all_ &&
- profile()) {
+ if (browser_defaults::kPhantomTabsEnabled && IsTabPinned(index) &&
+ !IsPhantomTab(index) && !closing_all_ && profile()) {
if (!IsAppTab(index))
return true; // Always make non-app tabs go phantom.
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc
index 51f9543..11fb91d 100644
--- a/chrome/browser/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/tabs/tab_strip_model_unittest.cc
@@ -9,6 +9,7 @@
#include "base/string_util.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
+#include "chrome/browser/defaults.h"
#include "chrome/browser/dom_ui/new_tab_ui.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/profile_manager.h"
@@ -1770,6 +1771,9 @@ TEST_F(TabStripModelTest, Pinning) {
// Tests various permutations of making a tab phantom.
TEST_F(TabStripModelTest, Phantom) {
+ if (!browser_defaults::kPhantomTabsEnabled)
+ return;
+
TabStripDummyDelegate delegate(NULL);
TabStripModel tabstrip(&delegate, profile());
MockTabStripModelObserver observer;