OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "chrome/browser/ui/select_file_dialog.h" | 11 #include "chrome/browser/ui/select_file_dialog.h" |
12 #include "content/public/browser/download_manager_delegate.h" | 12 #include "content/public/browser/download_manager_delegate.h" |
13 | 13 |
14 class DownloadPrefs; | 14 class DownloadPrefs; |
15 | 15 |
16 // Handles showing a dialog to the user to ask for the filename to save a page. | 16 // Handles showing a dialog to the user to ask for the filename to save a page. |
Randy Smith (Not in Mondays)
2012/03/26 21:08:33
Could you put a comment here (probably under a TOD
achuithb
2012/03/26 21:35:54
Probably shouldn't be doing it here?
| |
17 class SavePackageFilePicker : public SelectFileDialog::Listener { | 17 class SavePackageFilePicker : public SelectFileDialog::Listener { |
18 public: | 18 public: |
19 SavePackageFilePicker(content::WebContents* web_contents, | 19 SavePackageFilePicker(content::WebContents* web_contents, |
20 const FilePath& suggested_path, | 20 const FilePath& suggested_path, |
21 const FilePath::StringType& default_extension, | 21 const FilePath::StringType& default_extension, |
22 bool can_save_as_complete, | 22 bool can_save_as_complete, |
23 DownloadPrefs* download_prefs, | 23 DownloadPrefs* download_prefs, |
24 content::SaveFilePathPickedCallback callback); | 24 content::SaveFilePathPickedCallback callback); |
25 virtual ~SavePackageFilePicker(); | 25 virtual ~SavePackageFilePicker(); |
26 | 26 |
27 // Used to disable prompting the user for a directory/filename of the saved | 27 // Used to disable prompting the user for a directory/filename of the saved |
28 // web page. This is available for testing. | 28 // web page. This is available for testing. |
29 static void SetShouldPromptUser(bool should_prompt); | 29 static void SetShouldPromptUser(bool should_prompt); |
30 | 30 |
31 private: | 31 protected: |
Randy Smith (Not in Mondays)
2012/03/26 21:08:33
We didn't talk about this on VC, but (given Zel's
achuithb
2012/03/26 21:35:54
That's true, so I'll take a look at doing this nex
| |
32 // SelectFileDialog::Listener implementation. | 32 // SelectFileDialog::Listener implementation. |
33 virtual void FileSelected(const FilePath& path, | 33 virtual void FileSelected(const FilePath& path, |
34 int index, | 34 int index, |
35 void* params) OVERRIDE; | 35 void* params) OVERRIDE; |
36 virtual void FileSelectionCanceled(void* params) OVERRIDE; | 36 virtual void FileSelectionCanceled(void* params) OVERRIDE; |
37 | 37 |
38 // Used to look up the renderer process for this request to get the context. | 38 // Used to look up the renderer process for this request to get the context. |
39 int render_process_id_; | 39 int render_process_id_; |
40 | 40 |
41 content::SaveFilePathPickedCallback callback_; | 41 content::SaveFilePathPickedCallback callback_; |
42 | 42 |
43 // For managing select file dialogs. | 43 // For managing select file dialogs. |
44 scoped_refptr<SelectFileDialog> select_file_dialog_; | 44 scoped_refptr<SelectFileDialog> select_file_dialog_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePicker); | 46 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePicker); |
47 }; | 47 }; |
48 | 48 |
49 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ | 49 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ |
OLD | NEW |