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

Unified Diff: chrome/browser/views/new_profile_dialog.cc

Issue 271056: Do some cleanup of file path name handling. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/browser/views/new_profile_dialog.cc
===================================================================
--- chrome/browser/views/new_profile_dialog.cc (revision 29772)
+++ chrome/browser/views/new_profile_dialog.cc (working copy)
@@ -65,12 +65,14 @@
MessageBoxFlags::DialogButton button) const {
if (button == MessageBoxFlags::DIALOGBUTTON_OK) {
std::wstring profile_name = message_box_view_->GetInputText();
- // TODO(munjal): Refactor the function ReplaceIllegalCharacters in
- // file_util to something that just checks if there are illegal chars
- // since that's what we really need. Also, replaceIllegalChars seems to
- // be expensive since it builds a list of illegal characters for each call.
- // So at the least fix that.
- file_util::ReplaceIllegalCharacters(&profile_name, L'_');
+
+#if defined(OS_POSIX)
+ std::string profile_name_narrow = WideToUTF8(profile_name);
+ file_util::ReplaceIllegalCharactersInPath(&profile_name_narrow, '_');
+ profile_name = UTF8ToWide(profile_name_narrow);
+#else
+ file_util::ReplaceIllegalCharactersInPath(&profile_name, '_');
+#endif
return !profile_name.empty() &&
profile_name == message_box_view_->GetInputText();
}
« no previous file with comments | « chrome/browser/shell_integration_linux.cc ('k') | chrome/browser/views/tab_contents/tab_contents_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698