summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 20:31:10 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 20:31:10 +0000
commit3d58bf7f98b0bc1b26c5d7c919edd49e919273a8 (patch)
tree20571bb66ed6e45d3236e5a537042234f40ebff4 /chrome
parent54fe91778e4ed5d5a8a513c6883ae40a2a7c1f6f (diff)
downloadchromium_src-3d58bf7f98b0bc1b26c5d7c919edd49e919273a8.zip
chromium_src-3d58bf7f98b0bc1b26c5d7c919edd49e919273a8.tar.gz
chromium_src-3d58bf7f98b0bc1b26c5d7c919edd49e919273a8.tar.bz2
Disables phantom tabs. I'm not nuking all the code as Nicholas/Glen thought we may yet try them again shortly.
BUG=46852 TEST=none Review URL: http://codereview.chromium.org/2833026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-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;