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

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

Issue 256022: Loads local resources from current locale subtree if available, if not it fal... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/browser/extensions/extension_file_util.cc
===================================================================
--- chrome/browser/extensions/extension_file_util.cc (revision 28272)
+++ chrome/browser/extensions/extension_file_util.cc (working copy)
@@ -137,7 +137,7 @@
// Validate icons exist.
for (std::map<int, std::string>::const_iterator iter =
extension->icons().begin(); iter != extension->icons().end(); ++iter) {
- if (!file_util::PathExists(extension->GetResourcePath(iter->second))) {
+ if (extension->GetResource(iter->second).GetFilePath().empty()) {
*error = StringPrintf("Could not load extension icon '%s'.",
iter->second.c_str());
return false;
@@ -172,8 +172,9 @@
const UserScript& script = extension->content_scripts()[i];
for (size_t j = 0; j < script.js_scripts().size(); j++) {
- const FilePath& path = script.js_scripts()[j].path();
- if (!file_util::PathExists(path)) {
+ const FilePath& path =
+ script.js_scripts()[j].resource().GetFilePath();
+ if (path.empty()) {
*error = StringPrintf("Could not load '%s' for content script.",
WideToUTF8(path.ToWStringHack()).c_str());
return false;
@@ -181,8 +182,9 @@
}
for (size_t j = 0; j < script.css_scripts().size(); j++) {
- const FilePath& path = script.css_scripts()[j].path();
- if (!file_util::PathExists(path)) {
+ const FilePath& path =
+ script.css_scripts()[j].resource().GetFilePath();
+ if (path.empty()) {
*error = StringPrintf("Could not load '%s' for content script.",
WideToUTF8(path.ToWStringHack()).c_str());
return false;
@@ -219,7 +221,7 @@
const std::vector<std::string>& icon_paths = page_action->icon_paths();
for (std::vector<std::string>::const_iterator iter = icon_paths.begin();
iter != icon_paths.end(); ++iter) {
- if (!file_util::PathExists(extension->GetResourcePath(*iter))) {
+ if (extension->GetResource(*iter).GetFilePath().empty()) {
*error = StringPrintf("Could not load icon '%s' for page action.",
iter->c_str());
return false;
@@ -233,7 +235,7 @@
const std::vector<std::string>& icon_paths = browser_action->icon_paths();
for (std::vector<std::string>::const_iterator iter = icon_paths.begin();
iter != icon_paths.end(); ++iter) {
- if (!file_util::PathExists(extension->GetResourcePath(*iter))) {
+ if (extension->GetResource(*iter).GetFilePath().empty()) {
*error = StringPrintf("Could not load icon '%s' for browser action.",
iter->c_str());
return false;
« no previous file with comments | « chrome/browser/extensions/extension_disabled_infobar_delegate.cc ('k') | chrome/browser/extensions/extension_l10n_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698