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

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

Issue 6597075: FilePath: add a convertor to ASCII (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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
« base/file_path.h ('K') | « chrome/browser/spellcheck_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_l10n_util.cc
diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc
index dff8f5e69c81f0046c3cca39d1f77d3f38ca6dbf..dad4d06cebd25cbc147f9b421a52a820f2f41884 100644
--- a/chrome/common/extensions/extension_l10n_util.cc
+++ b/chrome/common/extensions/extension_l10n_util.cc
@@ -277,13 +277,18 @@ bool ShouldSkipValidation(const FilePath& locales_path,
// skipping any strings with '.'. This happens sometimes, for example with
// '.svn' directories.
FilePath relative_path;
- if (!locales_path.AppendRelativePath(locale_path, &relative_path))
+ if (!locales_path.AppendRelativePath(locale_path, &relative_path)) {
NOTREACHED();
- std::wstring subdir(relative_path.ToWStringHack());
- if (std::find(subdir.begin(), subdir.end(), L'.') != subdir.end())
+ return true;
+ }
+ std::string subdir = relative_path.MaybeAsASCII();
+ if (subdir.empty())
+ return true; // Non-ASCII.
+
+ if (std::find(subdir.begin(), subdir.end(), '.') != subdir.end())
return true;
- if (all_locales.find(WideToASCII(subdir)) == all_locales.end())
+ if (all_locales.find(subdir) == all_locales.end())
return true;
return false;
« base/file_path.h ('K') | « chrome/browser/spellcheck_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698