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

Unified Diff: chrome/browser/download/download_file_picker.cc

Issue 10667026: Start consolidating cross-port file selection code into ui/base/dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Attempt to fix win 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
Index: chrome/browser/download/download_file_picker.cc
diff --git a/chrome/browser/download/download_file_picker.cc b/chrome/browser/download/download_file_picker.cc
index dbac2ae97423e445534adfaf6ea32150b4a04be9..c115cab2da8e40b4c35c470c1ed340da72366f49 100644
--- a/chrome/browser/download/download_file_picker.cc
+++ b/chrome/browser/download/download_file_picker.cc
@@ -7,6 +7,7 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/web_contents.h"
@@ -64,7 +65,9 @@ void DownloadFilePicker::Init(DownloadManager* download_manager,
InitSuggestedPath(item);
DCHECK(download_manager_);
- select_file_dialog_ = SelectFileDialog::Create(this);
+ WebContents* web_contents = item->GetWebContents();
+ select_file_dialog_ = SelectFileDialog::Create(
+ this, new ChromeSelectFilePolicy(web_contents));
SelectFileDialog::FileTypeInfo file_type_info;
FilePath::StringType extension = suggested_path_.Extension();
if (!extension.empty()) {
@@ -73,15 +76,18 @@ void DownloadFilePicker::Init(DownloadManager* download_manager,
file_type_info.extensions[0].push_back(extension);
}
file_type_info.include_all_files = true;
- WebContents* web_contents = item->GetWebContents();
gfx::NativeWindow owning_window = web_contents ?
platform_util::GetTopLevel(web_contents->GetNativeView()) : NULL;
- select_file_dialog_->SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE,
- string16(),
- suggested_path_,
- &file_type_info, 0, FILE_PATH_LITERAL(""),
- web_contents, owning_window, NULL);
+ select_file_dialog_->SelectFile(
+ SelectFileDialog::SELECT_SAVEAS_FILE,
+ string16(),
+ suggested_path_,
+ &file_type_info,
+ 0,
+ FILE_PATH_LITERAL(""),
+ owning_window,
+ NULL);
}
DownloadFilePicker::~DownloadFilePicker() {
« no previous file with comments | « chrome/browser/debugger/devtools_file_helper.cc ('k') | chrome/browser/download/save_package_file_picker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698