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

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

Issue 10914244: Remove support for page_action.icons, and the legacy code surrounding it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: constants removed Created 8 years, 3 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/api/page_action.json ('k') | chrome/common/extensions/extension_action.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 d99dd013e5283244d471899696d3daf95401a8a5..78dcdffa8e7eead4fa80b110aa74f15d102e4386 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -810,6 +810,8 @@ scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper(
ExtensionAction::ACTIVE : ExtensionAction::INVISIBLE);
if (manifest_version_ == 1) {
+ // kPageActionIcons is obsolete, and used by very few extensions. Continue
+ // loading it, but only take the first icon as the default_icon path.
const ListValue* icons = NULL;
if (extension_action->HasKey(keys::kPageActionIcons) &&
extension_action->GetList(keys::kPageActionIcons, &icons)) {
@@ -821,7 +823,8 @@ scoped_ptr<ExtensionAction> Extension::LoadExtensionActionHelper(
return scoped_ptr<ExtensionAction>();
}
- result->icon_paths()->push_back(path);
+ result->set_default_icon_path(path);
+ break;
}
}
@@ -3199,20 +3202,14 @@ std::set<FilePath> Extension::GetBrowserImages() const {
// Page action icons.
if (page_action()) {
- std::vector<std::string>* icon_paths = page_action()->icon_paths();
- for (std::vector<std::string>::iterator iter = icon_paths->begin();
- iter != icon_paths->end(); ++iter) {
- image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(*iter)));
- }
+ image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(
+ page_action()->default_icon_path())));
}
// Browser action icons.
if (browser_action()) {
- std::vector<std::string>* icon_paths = browser_action()->icon_paths();
- for (std::vector<std::string>::iterator iter = icon_paths->begin();
- iter != icon_paths->end(); ++iter) {
- image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(*iter)));
- }
+ image_paths.insert(FilePath::FromWStringHack(UTF8ToWide(
+ browser_action()->default_icon_path())));
}
return image_paths;
« no previous file with comments | « chrome/common/extensions/api/page_action.json ('k') | chrome/common/extensions/extension_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698