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

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

Issue 3117017: Remove deprecated wstring Get(As)String() methods from Value, etc. (Closed)
Patch Set: fix win Created 10 years, 4 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 | « chrome/browser/translate/translate_prefs.cc ('k') | chrome/common/automation_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/select_file_dialog.cc
diff --git a/chrome/browser/views/select_file_dialog.cc b/chrome/browser/views/select_file_dialog.cc
index 0d523a809a5df0c160c0718f8d7d166cca93b686..0f2aaaa18f031b543483025c59ff26dd0b146f07 100644
--- a/chrome/browser/views/select_file_dialog.cc
+++ b/chrome/browser/views/select_file_dialog.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
+#include "chrome/browser/profile_manager.h"
#include "chrome/browser/shell_dialogs.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/views/browser_dialogs.h"
@@ -25,14 +26,12 @@
#include "views/window/non_client_view.h"
#include "views/window/window.h"
-#include "chrome/browser/profile_manager.h"
-
namespace {
-static const wchar_t* kKeyNamePath = L"path";
-static const int kSaveCompletePageIndex = 2;
+const char kKeyNamePath[] = "path";
+const int kSaveCompletePageIndex = 2;
-}; // namespace
+} // namespace
// Implementation of SelectFileDialog that shows an UI for choosing a file
// or folder using FileBrowseUI.
@@ -257,10 +256,10 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate,
if (delegate->type_ == SELECT_OPEN_FILE ||
delegate->type_ == SELECT_SAVEAS_FILE ||
delegate->type_ == SELECT_FOLDER) {
- std::wstring path_string;
+ std::string path_string;
if (dict->HasKey(kKeyNamePath) &&
dict->GetString(kKeyNamePath, &path_string)) {
- FilePath path = FilePath::FromWStringHack(path_string);
+ FilePath path = FilePath::FromWStringHack(UTF8ToWide(path_string));
listener_->FileSelected(path, kSaveCompletePageIndex,
delegate->params_);
@@ -274,10 +273,11 @@ void SelectFileDialogImpl::OnDialogClosed(FileBrowseDelegate* delegate,
std::vector<FilePath> paths;
paths.reserve(paths_value->GetSize());
for (size_t i = 0; i < paths_value->GetSize(); ++i) {
- std::wstring path_string;
+ std::string path_string;
if (paths_value->GetString(i, &path_string) &&
!path_string.empty()) {
- paths.push_back(FilePath::FromWStringHack(path_string));
+ paths.push_back(FilePath::FromWStringHack(
+ UTF8ToWide(path_string)));
}
}
« no previous file with comments | « chrome/browser/translate/translate_prefs.cc ('k') | chrome/common/automation_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698