Commit 16c5c87e authored by tfarina@chromium.org's avatar tfarina@chromium.org

Get rid of FromWStringHack in select_file_dialog.cc

BUG=24672
TEST=trybots

Review URL: http://codereview.chromium.org/6193003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71314 0039d316-1c4b-4281-b951-d872f2087c98
parent 22f97080
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/scoped_ptr.h" #include "base/scoped_ptr.h"
#include "base/string_util.h" #include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/browser_list.h" #include "chrome/browser/browser_list.h"
...@@ -263,8 +264,12 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate, ...@@ -263,8 +264,12 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate,
std::string path_string; std::string path_string;
if (dict->HasKey(kKeyNamePath) && if (dict->HasKey(kKeyNamePath) &&
dict->GetString(kKeyNamePath, &path_string)) { 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, listener_->FileSelected(path, kSaveCompletePageIndex,
delegate->params_); delegate->params_);
notification_fired = true; notification_fired = true;
...@@ -280,8 +285,13 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate, ...@@ -280,8 +285,13 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate,
std::string path_string; std::string path_string;
if (paths_value->GetString(i, &path_string) && if (paths_value->GetString(i, &path_string) &&
!path_string.empty()) { !path_string.empty()) {
paths.push_back(FilePath::FromWStringHack( #if defined(OS_WIN)
UTF8ToWide(path_string))); FilePath path(base::SysUTF8ToWide(path_string));
#else
FilePath path(
base::SysWideToNativeMB(base::SysUTF8ToWide(path_string)));
#endif
paths.push_back(path);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment