Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5094)

Unified Diff: chrome/common/extensions/extension.cc

Issue 434026: disable extension toolstrips by default, adding (Closed)
Patch Set: fix a failing test Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index ce31c80e88546ab411d89ac4ef4c1ac52359d28c..b469ed5e3cc56eaefa3f2c083538a26c9ee66284 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)) {
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698