summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_file_util.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 23:08:48 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 23:08:48 +0000
commit33c283854d03dab96fa9482f4eccac0ae28d738c (patch)
tree6e10ad36da5976f2c09b370440a54e194e50c348 /chrome/browser/extensions/extension_file_util.cc
parent42062e78622add4b84f872707530670d4894d5c9 (diff)
downloadchromium_src-33c283854d03dab96fa9482f4eccac0ae28d738c.zip
chromium_src-33c283854d03dab96fa9482f4eccac0ae28d738c.tar.gz
chromium_src-33c283854d03dab96fa9482f4eccac0ae28d738c.tar.bz2
ExtensionResource::GetFilePath returns empty path if it
fails to resolve the css and js script files specified in the manifest. We shouldn't rely on the results of GetFilePath in the error, but show the relative path instead. BUG=27423 TEST=Create an extension with a content script, but specify a css and a js file that doesn't exist. The error message should be descriptive and make sense. Review URL: http://codereview.chromium.org/385052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_file_util.cc')
-rw-r--r--chrome/browser/extensions/extension_file_util.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_file_util.cc b/chrome/browser/extensions/extension_file_util.cc
index 26a551b..52c2c78 100644
--- a/chrome/browser/extensions/extension_file_util.cc
+++ b/chrome/browser/extensions/extension_file_util.cc
@@ -189,8 +189,9 @@ bool ValidateExtension(Extension* extension, std::string* error) {
const FilePath& path = ExtensionResource::GetFilePath(
js_script.extension_root(), js_script.relative_path());
if (!file_util::PathExists(path)) {
- *error = StringPrintf("Could not load '%s' for content script.",
- WideToUTF8(path.ToWStringHack()).c_str());
+ *error = StringPrintf(
+ "Could not load javascript '%s' for content script.",
+ WideToUTF8(js_script.relative_path().ToWStringHack()).c_str());
return false;
}
}
@@ -200,8 +201,9 @@ bool ValidateExtension(Extension* extension, std::string* error) {
const FilePath& path = ExtensionResource::GetFilePath(
css_script.extension_root(), css_script.relative_path());
if (!file_util::PathExists(path)) {
- *error = StringPrintf("Could not load '%s' for content script.",
- WideToUTF8(path.ToWStringHack()).c_str());
+ *error = StringPrintf(
+ "Could not load css '%s' for content script.",
+ WideToUTF8(css_script.relative_path().ToWStringHack()).c_str());
return false;
}
}