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

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

Issue 164547: Mac: make save/open dialogs operate as tab-modal sheets.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Painfully (but hopefully correctly) merged ToT. Created 11 years, 2 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/debugger/devtools_window.h ('k') | chrome/browser/download/download_request_manager.h » ('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 b9925e73c0ab5a130fb8e9363e8a18b32c908b6b..5a4b6492a1d6df08d127b0f5d6f1d4a38174b4e7 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -679,13 +679,30 @@ 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@gmail.com): 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;
+ contents ? platform_util::GetTopLevel(contents->GetNativeView()) : NULL
+
select_file_dialog_->SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE,
string16(),
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/debugger/devtools_window.h ('k') | chrome/browser/download/download_request_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698