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

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

Issue 10911300: Move ExtensionAction from common/ to browser/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: proof of concept 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..1a1dda1a1175fbc290776594e6779efa7d4262f8 100644
--- a/chrome/common/extensions/extension_file_util.cc
+++ b/chrome/common/extensions/extension_file_util.cc
@@ -20,7 +20,6 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_l10n_util.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_messages.h"
@@ -321,29 +320,24 @@ bool ValidateExtension(const Extension* extension,
}
// Validate icon location and icon file size for page actions.
- ExtensionAction* page_action = extension->page_action();
+ Extension::ActionInfo* 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)) {
- *error =
- l10n_util::GetStringFUTF8(
- IDS_EXTENSION_LOAD_ICON_FOR_PAGE_ACTION_FAILED,
- UTF8ToUTF16(*iter));
- return false;
- }
+ const FilePath path = extension->GetResource(
+ page_action->default_icon_path).GetFilePath();
+ if (!ValidateFilePath(path)) {
+ *error =
+ l10n_util::GetStringFUTF8(
+ IDS_EXTENSION_LOAD_ICON_FOR_PAGE_ACTION_FAILED,
+ UTF8ToUTF16(page_action->default_icon_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();
+ Extension::ActionInfo* browser_action = extension->browser_action();
if (browser_action) {
- std::string path = browser_action->default_icon_path();
+ std::string path = browser_action->default_icon_path;
if (!path.empty()) {
const FilePath file_path = extension->GetResource(path).GetFilePath();
if (!ValidateFilePath(file_path)) {

Powered by Google App Engine
This is Rietveld 408576698