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() { |