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

Unified Diff: chrome/browser/file_select_helper.cc

Issue 10804026: Fix open dialog not remembering last opened folder on drive (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 5 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/download/save_package_file_picker_chromeos.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/file_select_helper.cc
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index 67c886dab79bef3ca29b31b4a70b14af50047fc4..0c9669cf7f6241c187a22d872312c4db2ab9527d 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -67,14 +67,13 @@ void NotifyRenderViewHost(RenderViewHost* render_view_host,
render_view_host->FilesSelectedInChooser(files, permissions);
}
-// Converts a list of FilePaths to a list of SelectedFileInfo, with the
-// display name field left empty.
-std::vector<ui::SelectedFileInfo> ConvertToSelectedFileInfoList(
+// Converts a list of FilePaths to a list of ui::SelectedFileInfo.
+std::vector<ui::SelectedFileInfo> FilePathListToSelectedFileInfoList(
const std::vector<FilePath>& paths) {
std::vector<ui::SelectedFileInfo> selected_files;
for (size_t i = 0; i < paths.size(); ++i) {
selected_files.push_back(
- ui::SelectedFileInfo(paths[i], FilePath::StringType()));
+ ui::SelectedFileInfo(paths[i], paths[i]));
}
return selected_files;
}
@@ -118,9 +117,7 @@ FileSelectHelper::~FileSelectHelper() {
void FileSelectHelper::FileSelected(const FilePath& path,
int index, void* params) {
- FileSelectedWithExtraInfo(
- ui::SelectedFileInfo(path, FilePath::StringType()),
- index, params);
+ FileSelectedWithExtraInfo(ui::SelectedFileInfo(path, path), index, params);
}
void FileSelectHelper::FileSelectedWithExtraInfo(
@@ -130,9 +127,9 @@ void FileSelectHelper::FileSelectedWithExtraInfo(
if (!render_view_host_)
return;
- const FilePath& path = file.path;
- profile_->set_last_selected_directory(path.DirName());
+ profile_->set_last_selected_directory(file.file_path.DirName());
+ const FilePath& path = file.local_path;
if (dialog_type_ == SelectFileDialog::SELECT_FOLDER) {
StartNewEnumeration(path, kFileSelectEnumerationId, render_view_host_);
return;
@@ -149,7 +146,8 @@ void FileSelectHelper::FileSelectedWithExtraInfo(
void FileSelectHelper::MultiFilesSelected(const std::vector<FilePath>& files,
void* params) {
std::vector<ui::SelectedFileInfo> selected_files =
- ConvertToSelectedFileInfoList(files);
+ FilePathListToSelectedFileInfoList(files);
+
MultiFilesSelectedWithExtraInfo(selected_files, params);
}
@@ -157,7 +155,7 @@ void FileSelectHelper::MultiFilesSelectedWithExtraInfo(
const std::vector<ui::SelectedFileInfo>& files,
void* params) {
if (!files.empty())
- profile_->set_last_selected_directory(files[0].path.DirName());
+ profile_->set_last_selected_directory(files[0].file_path.DirName());
if (!render_view_host_)
return;
@@ -228,7 +226,7 @@ void FileSelectHelper::OnListDone(int id, int error) {
}
std::vector<ui::SelectedFileInfo> selected_files =
- ConvertToSelectedFileInfoList(entry->results_);
+ FilePathListToSelectedFileInfoList(entry->results_);
if (id == kFileSelectEnumerationId)
NotifyRenderViewHost(entry->rvh_, selected_files, dialog_type_);
« no previous file with comments | « chrome/browser/download/save_package_file_picker_chromeos.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698