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

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

Issue 459008: Mac: the return of the tab-modal-sheets patch. (Closed)
Patch Set: Merged ToT. Must ... commit ... soon. Created 11 years 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/cocoa/tab_strip_controller.mm ('k') | chrome/browser/download/save_package.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 21642efd2c9cce177b4cd6d33b5714d75c6a35c9..e0db75d271a80ed6c8d5badcffe260a45a248ee6 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -660,6 +660,21 @@ void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
if (!file_type_info.extensions[0][0].empty())
file_type_info.extensions[0][0].erase(0, 1); // drop the .
file_type_info.include_all_files = true;
+#if defined(OS_MACOSX)
+ // If |contents| is NULL, file selection should theoretically run modeless.
+ // FIXME(viettrungluu): But we don't actually currently support modeless
+ // file selection dialogs on Mac. Does this ever happen? Should it? Better
+ // dcheck it.
+ DCHECK(contents);
+ select_file_dialog_->SelectFileInTab(SelectFileDialog::SELECT_SAVEAS_FILE,
+ string16(),
+ info->suggested_path,
+ &file_type_info,
+ 0,
+ FILE_PATH_LITERAL(""),
+ contents,
+ info);
+#else
gfx::NativeWindow owning_window =
contents ? platform_util::GetTopLevel(contents->GetNativeView()) : NULL;
select_file_dialog_->SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE,
@@ -667,6 +682,7 @@ void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
info->suggested_path,
&file_type_info, 0, FILE_PATH_LITERAL(""),
owning_window, info);
+#endif
} else {
// No prompting for download, just continue with the suggested name.
ContinueStartDownload(info, info->suggested_path);
« no previous file with comments | « chrome/browser/cocoa/tab_strip_controller.mm ('k') | chrome/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698