summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/common/extensions/extension.cc5
-rw-r--r--chrome/common/extensions/extension.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 5df2a35..0be0dbc 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -499,8 +499,11 @@ bool Extension::IdIsValid(const std::string& id) {
// static
std::string Extension::GenerateIdForPath(const FilePath& path) {
FilePath new_path = Extension::MaybeNormalizePath(path);
+ std::string path_bytes =
+ std::string(reinterpret_cast<const char*>(new_path.value().data()),
+ new_path.value().size() * sizeof(FilePath::CharType));
std::string id;
- if (!GenerateId(WideToUTF8(new_path.ToWStringHack()), &id))
+ if (!GenerateId(path_bytes, &id))
return "";
return id;
}
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 498ec66..7e2b593 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -229,6 +229,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
static bool IdIsValid(const std::string& id);
// Generate an ID for an extension in the given path.
+ // Used while developing extensions, before they have a key.
static std::string GenerateIdForPath(const FilePath& file_name);
// Returns true if the specified file is an extension.