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

Unified Diff: chrome/common/extensions/extension_file_util.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
Index: chrome/common/extensions/extension_file_util.cc
diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc
index 7b92b93bb6336ccf153094917e87e9113893edd7..2b94f67bd953f19917635eab0b988ae2bcaa1ed3 100644
--- a/chrome/common/extensions/extension_file_util.cc
+++ b/chrome/common/extensions/extension_file_util.cc
@@ -323,24 +323,20 @@ bool ValidateExtension(const Extension* extension,
// Validate icon location and icon file size for page actions.
ExtensionAction* page_action = extension->page_action();
if (page_action) {
- std::vector<std::string> icon_paths(*page_action->icon_paths());
- if (!page_action->default_icon_path().empty())
- icon_paths.push_back(page_action->default_icon_path());
- for (std::vector<std::string>::iterator iter = icon_paths.begin();
- iter != icon_paths.end(); ++iter) {
- const FilePath path = extension->GetResource(*iter).GetFilePath();
- if (!ValidateFilePath(path)) {
+ std::string path = page_action->default_icon_path();
+ if (!path.empty()) {
+ const FilePath file_path = extension->GetResource(path).GetFilePath();
+ if (!ValidateFilePath(file_path)) {
*error =
l10n_util::GetStringFUTF8(
IDS_EXTENSION_LOAD_ICON_FOR_PAGE_ACTION_FAILED,
- UTF8ToUTF16(*iter));
+ UTF8ToUTF16(path));
return false;
}
}
}
// Validate icon location and icon file size for browser actions.
- // Note: browser actions don't use the icon_paths().
ExtensionAction* browser_action = extension->browser_action();
if (browser_action) {
std::string path = browser_action->default_icon_path();
« no previous file with comments | « chrome/common/extensions/extension_action_unittest.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698