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

Unified Diff: chrome/browser/file_select_helper.cc

Issue 10669023: Start consolidating non-port specific code to ui/base/dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clenaup Created 8 years, 6 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/file_select_helper.h ('k') | chrome/browser/ui/base_shell_dialog.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 e1183782ab6b157bf41be914597cb1f8752780a6..9c11232eaa575021cab34cab52b7eb31ba6ece12 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -23,9 +23,9 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/file_chooser_params.h"
-#include "content/public/common/selected_file_info.h"
#include "grit/generated_resources.h"
#include "net/base/mime_util.h"
+#include "ui/base/dialogs/selected_file_info.h"
#include "ui/base/l10n/l10n_util.h"
using content::BrowserThread;
@@ -42,7 +42,7 @@ namespace {
const int kFileSelectEnumerationId = -1;
void NotifyRenderViewHost(RenderViewHost* render_view_host,
- const std::vector<content::SelectedFileInfo>& files,
+ const std::vector<ui::SelectedFileInfo>& files,
SelectFileDialog::Type dialog_type) {
const int kReadFilePermissions =
base::PLATFORM_FILE_OPEN |
@@ -68,12 +68,12 @@ void NotifyRenderViewHost(RenderViewHost* render_view_host,
// Converts a list of FilePaths to a list of SelectedFileInfo, with the
// display name field left empty.
-std::vector<content::SelectedFileInfo> ConvertToSelectedFileInfoList(
+std::vector<ui::SelectedFileInfo> ConvertToSelectedFileInfoList(
const std::vector<FilePath>& paths) {
- std::vector<content::SelectedFileInfo> selected_files;
+ std::vector<ui::SelectedFileInfo> selected_files;
for (size_t i = 0; i < paths.size(); ++i) {
selected_files.push_back(
- content::SelectedFileInfo(paths[i], FilePath::StringType()));
+ ui::SelectedFileInfo(paths[i], FilePath::StringType()));
}
return selected_files;
}
@@ -118,12 +118,12 @@ FileSelectHelper::~FileSelectHelper() {
void FileSelectHelper::FileSelected(const FilePath& path,
int index, void* params) {
FileSelectedWithExtraInfo(
- content::SelectedFileInfo(path, FilePath::StringType()),
+ ui::SelectedFileInfo(path, FilePath::StringType()),
index, params);
}
void FileSelectHelper::FileSelectedWithExtraInfo(
- const content::SelectedFileInfo& file,
+ const ui::SelectedFileInfo& file,
int index,
void* params) {
if (!render_view_host_)
@@ -137,7 +137,7 @@ void FileSelectHelper::FileSelectedWithExtraInfo(
return;
}
- std::vector<content::SelectedFileInfo> files;
+ std::vector<ui::SelectedFileInfo> files;
files.push_back(file);
NotifyRenderViewHost(render_view_host_, files, dialog_type_);
@@ -147,13 +147,13 @@ void FileSelectHelper::FileSelectedWithExtraInfo(
void FileSelectHelper::MultiFilesSelected(const std::vector<FilePath>& files,
void* params) {
- std::vector<content::SelectedFileInfo> selected_files =
+ std::vector<ui::SelectedFileInfo> selected_files =
ConvertToSelectedFileInfoList(files);
MultiFilesSelectedWithExtraInfo(selected_files, params);
}
void FileSelectHelper::MultiFilesSelectedWithExtraInfo(
- const std::vector<content::SelectedFileInfo>& files,
+ const std::vector<ui::SelectedFileInfo>& files,
void* params) {
if (!files.empty())
profile_->set_last_selected_directory(files[0].path.DirName());
@@ -173,7 +173,7 @@ void FileSelectHelper::FileSelectionCanceled(void* params) {
// If the user cancels choosing a file to upload we pass back an
// empty vector.
NotifyRenderViewHost(
- render_view_host_, std::vector<content::SelectedFileInfo>(),
+ render_view_host_, std::vector<ui::SelectedFileInfo>(),
dialog_type_);
// No members should be accessed from here on.
@@ -226,7 +226,7 @@ void FileSelectHelper::OnListDone(int id, int error) {
return;
}
- std::vector<content::SelectedFileInfo> selected_files =
+ std::vector<ui::SelectedFileInfo> selected_files =
ConvertToSelectedFileInfoList(entry->results_);
if (id == kFileSelectEnumerationId)
« no previous file with comments | « chrome/browser/file_select_helper.h ('k') | chrome/browser/ui/base_shell_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698