Index: base/file_path.cc |
diff --git a/base/file_path.cc b/base/file_path.cc |
index 5f1375adb5b8e9c98942bc69a474a8761d7682bb..907a4124b6a428845565a5f51aa687506c3b7bb3 100644 |
--- a/base/file_path.cc |
+++ b/base/file_path.cc |
@@ -520,6 +520,12 @@ string16 FilePath::LossyDisplayName() const { |
return WideToUTF16(base::SysNativeMBToWide(path_)); |
} |
+std::string FilePath::MaybeAsASCII() const { |
+ if (IsStringASCII(path_)) |
+ return path_; |
+ return ""; |
+} |
+ |
// The *Hack functions are temporary while we fix the remainder of the code. |
// Remember to remove the #includes at the top when you remove these. |
@@ -535,6 +541,12 @@ string16 FilePath::LossyDisplayName() const { |
return path_; |
} |
+std::string FilePath::MaybeAsASCII() const { |
+ if (IsStringASCII(path_)) |
+ return WideToASCII(path_); |
+ return ""; |
+} |
+ |
// static |
FilePath FilePath::FromWStringHack(const std::wstring& wstring) { |
return FilePath(wstring); |