File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 29
29
#include < commdlg.h>
30
30
#endif
31
31
32
+ #if defined(OS_MACOSX)
33
+ #include < AppKit/NSSavePanel.h>
34
+ #include < Foundation/NSURL.h>
35
+ #endif
36
+
32
37
#include " base/bind.h"
33
38
#include " base/file_util.h"
34
39
#include " base/logging.h"
@@ -189,7 +194,17 @@ void ShellDownloadManagerDelegate::ChooseDownloadPath(
189
194
}
190
195
gtk_widget_destroy (dialog);
191
196
#else
192
- NOTIMPLEMENTED ();
197
+ std::string base_name = FilePath (suggested_path).BaseName ().value ();
198
+
199
+ NSSavePanel *savePanel = [NSSavePanel savePanel ];
200
+
201
+ [savePanel setNamedFieldStringValue: [NSString stringWithUTF8String: base_name.c_str ()]];
202
+
203
+ if ([savePanel runModal ] == NSFileHandlingPanelOKButton ) {
204
+ char *filename = (char *)[[[savePanel URL ] path ] UTF8String ];
205
+
206
+ result = FilePath (filename);
207
+ }
193
208
#endif
194
209
195
210
callback.Run (result, DownloadItem::TARGET_DISPOSITION_PROMPT,
You can’t perform that action at this time.
0 commit comments