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

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

Issue 3129003: remove toolstrips (Closed)
Patch Set: merge Created 10 years, 4 months 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/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | 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 f494c67f2dc9fc4646b13d42c798f7466af974dd..630d91313f93fe6528ebec84780a6a7e736e63f0 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1244,10 +1244,11 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
options_url_ = GetResourceURL(options_str);
}
- // Initialize toolstrips (deprecated and optional).
- // TODO(erikkay) remove this altogether.
+ // Initialize toolstrips. This is deprecated for public use.
+ // NOTE(erikkay) Although deprecated, we intend to preserve this parsing
+ // code indefinitely. Please contact me or Joi for details as to why.
if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExtensionToolstrips) &&
+ switches::kEnableExperimentalExtensionApis) &&
source.HasKey(keys::kToolstrips)) {
ListValue* list_value;
if (!source.GetList(keys::kToolstrips, &list_value)) {
@@ -1256,12 +1257,12 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
}
for (size_t i = 0; i < list_value->GetSize(); ++i) {
- ToolstripInfo toolstrip;
+ GURL toolstrip;
DictionaryValue* toolstrip_value;
std::string toolstrip_path;
if (list_value->GetString(i, &toolstrip_path)) {
// Support a simple URL value for backwards compatibility.
- toolstrip.toolstrip = GetResourceURL(toolstrip_path);
+ toolstrip = GetResourceURL(toolstrip_path);
} else if (list_value->GetDictionary(i, &toolstrip_value)) {
if (!toolstrip_value->GetString(keys::kToolstripPath,
&toolstrip_path)) {
@@ -1269,25 +1270,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
errors::kInvalidToolstrip, base::IntToString(i));
return false;
}
- toolstrip.toolstrip = GetResourceURL(toolstrip_path);
- if (toolstrip_value->HasKey(keys::kToolstripMolePath)) {
- std::string mole_path;
- if (!toolstrip_value->GetString(keys::kToolstripMolePath,
- &mole_path)) {
- *error = ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidToolstrip, base::IntToString(i));
- return false;
- }
- int height;
- if (!toolstrip_value->GetInteger(keys::kToolstripMoleHeight,
- &height) || (height < 0)) {
- *error = ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidToolstrip, base::IntToString(i));
- return false;
- }
- toolstrip.mole = GetResourceURL(mole_path);
- toolstrip.mole_height = height;
- }
+ toolstrip = GetResourceURL(toolstrip_path);
} else {
*error = ExtensionErrorUtils::FormatErrorMessage(
errors::kInvalidToolstrip, base::IntToString(i));
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698