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

Unified Diff: chrome/browser/ui/views/select_file_dialog.cc

Issue 6193003: Get rid of FromWStringHack in select_file_dialog.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: #else 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/select_file_dialog.cc
diff --git a/chrome/browser/ui/views/select_file_dialog.cc b/chrome/browser/ui/views/select_file_dialog.cc
index 4ce6fa7f95dc9e28da95263ae377d945c69270be..1570a9eb402ddb2b4fde2da640b282dd6902afc7 100644
--- a/chrome/browser/ui/views/select_file_dialog.cc
+++ b/chrome/browser/ui/views/select_file_dialog.cc
@@ -10,6 +10,7 @@
#include "base/json/json_reader.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
+#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_list.h"
@@ -263,8 +264,12 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate,
std::string path_string;
if (dict->HasKey(kKeyNamePath) &&
dict->GetString(kKeyNamePath, &path_string)) {
- FilePath path = FilePath::FromWStringHack(UTF8ToWide(path_string));
-
+#if defined(OS_WIN)
+ FilePath path(base::SysUTF8ToWide(path_string));
+#else
+ FilePath path(
+ base::SysWideToNativeMB(base::SysUTF8ToWide(path_string)));
+#endif
listener_->FileSelected(path, kSaveCompletePageIndex,
delegate->params_);
notification_fired = true;
@@ -280,8 +285,13 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate,
std::string path_string;
if (paths_value->GetString(i, &path_string) &&
!path_string.empty()) {
- paths.push_back(FilePath::FromWStringHack(
- UTF8ToWide(path_string)));
+#if defined(OS_WIN)
+ FilePath path(base::SysUTF8ToWide(path_string));
+#else
+ FilePath path(
+ base::SysWideToNativeMB(base::SysUTF8ToWide(path_string)));
+#endif
+ paths.push_back(path);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698