diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 16:33:12 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 16:33:12 +0000 |
commit | 856c8d7042e2b09167733c5f186075bbf43ae5ed (patch) | |
tree | 44518a5f6a251ba998c149e0cb81ec202076da07 | |
parent | 0840cc764d0f0b693d3762c356b7d35e58d343af (diff) | |
download | chromium_src-856c8d7042e2b09167733c5f186075bbf43ae5ed.zip chromium_src-856c8d7042e2b09167733c5f186075bbf43ae5ed.tar.gz chromium_src-856c8d7042e2b09167733c5f186075bbf43ae5ed.tar.bz2 |
disable extension toolstrips by default, adding
--enable-extension-toolstrips
BUG=24475
TEST=Extension*Toolstrip*
Review URL: http://codereview.chromium.org/434026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32928 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_browsertest.cc | 5 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service_unittest.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/common/extensions/extension.cc | 10 |
5 files changed, 17 insertions, 5 deletions
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 0fca208..e32f8be 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -41,6 +41,11 @@ void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) { PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); test_data_dir_ = test_data_dir_.AppendASCII("extensions"); + + // There are a number of tests that still use toolstrips. Rather than + // selectively enabling each of them, enable toolstrips for all extension + // tests. + command_line->AppendSwitch(switches::kEnableExtensionToolstrips); } bool ExtensionBrowserTest::LoadExtension(const FilePath& path) { diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc index f9af689..69e0c86 100644 --- a/chrome/browser/extensions/extensions_service_unittest.cc +++ b/chrome/browser/extensions/extensions_service_unittest.cc @@ -220,6 +220,9 @@ class ExtensionsServiceTest const FilePath& extensions_install_dir) { prefs_.reset(new PrefService(pref_file)); profile_.reset(new TestingProfile()); + + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableExtensionToolstrips); service_ = new ExtensionsService(profile_.get(), CommandLine::ForCurrentProcess(), prefs_.get(), diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index bc23ce5..fae9535 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -184,6 +184,9 @@ const char kEnableExperimentalWebGL[] = "enable-webgl"; // Enable experimental timeline API. const char kEnableExtensionTimelineApi[] = "enable-extension-timeline-api"; +// Enable extension toolstrips (deprecated API - will be removed). +const char kEnableExtensionToolstrips[] = "enable-extension-toolstrips"; + // Enable the fastback page cache. const char kEnableFastback[] = "enable-fastback"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index f521615..986effa 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -68,6 +68,7 @@ extern const char kEnableBenchmarking[]; extern const char kEnableExperimentalExtensionApis[]; extern const char kEnableExperimentalWebGL[]; extern const char kEnableExtensionTimelineApi[]; +extern const char kEnableExtensionToolstrips[]; extern const char kEnableFastback[]; extern const char kEnableFileCookies[]; extern const char kDisableLocalStorage[]; diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index fd22f24..6e8c481 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -918,8 +918,11 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id, options_url_ = GetResourceURL(options_str); } - // Initialize toolstrips (optional). - if (source.HasKey(keys::kToolstrips)) { + // Initialize toolstrips (deprecated and optional). + // TODO(erikkay) remove this altogether. + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableExtensionToolstrips) && + source.HasKey(keys::kToolstrips)) { ListValue* list_value; if (!source.GetList(keys::kToolstrips, &list_value)) { *error = errors::kInvalidToolstrips; @@ -932,7 +935,6 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id, std::string toolstrip_path; if (list_value->GetString(i, &toolstrip_path)) { // Support a simple URL value for backwards compatibility. - // TODO(erikkay) Perhaps deprecate this in the future. toolstrip.toolstrip = GetResourceURL(toolstrip_path); } else if (list_value->GetDictionary(i, &toolstrip_value)) { if (!toolstrip_value->GetString(keys::kToolstripPath, @@ -950,8 +952,6 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id, errors::kInvalidToolstrip, IntToString(i)); return false; } - // TODO(erikkay) is there a better way to get this dynamically - // from the content itself? int height; if (!toolstrip_value->GetInteger(keys::kToolstripMoleHeight, &height) || (height < 0)) { |