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

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

Issue 6246036: FilePath: Remove most of ToWStringHack, adding a LossyDisplayName() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index b4824c9448d14f09ada3ad602ce3406e31a231e3..287aa4c97f6c0f559744a527e1fb0d986f7785b9 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -468,7 +468,7 @@ bool Extension::IdIsValid(const std::string& id) {
std::string Extension::GenerateIdForPath(const FilePath& path) {
FilePath new_path = Extension::MaybeNormalizePath(path);
std::string id;
- if (!GenerateId(WideToUTF8(new_path.ToWStringHack()), &id))
+ if (!GenerateId(UTF16ToUTF8(new_path.LossyDisplayName()), &id))
Mark Mentovai 2011/02/01 22:54:55 Not for display?
return "";
return id;
}
@@ -1244,8 +1244,7 @@ void Extension::DecodeIconFromPath(const FilePath& icon_path,
std::string file_contents;
if (!file_util::ReadFileToString(icon_path, &file_contents)) {
- LOG(ERROR) << "Could not read icon file: "
- << WideToUTF8(icon_path.ToWStringHack());
+ LOG(ERROR) << "Could not read icon file: " << icon_path.LossyDisplayName();
return;
}
@@ -1257,7 +1256,7 @@ void Extension::DecodeIconFromPath(const FilePath& icon_path,
*decoded = decoder.Decode(data, file_contents.length());
if (decoded->empty()) {
LOG(ERROR) << "Could not decode icon file: "
- << WideToUTF8(icon_path.ToWStringHack());
+ << icon_path.LossyDisplayName();
return;
}

Powered by Google App Engine
This is Rietveld 408576698