OLD | NEW |
1 // Copyright (c) 2012 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_DOWNLOAD_FILE_PICKER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/select_file_dialog.h" | 9 #include "chrome/browser/ui/select_file_dialog.h" |
10 #include "content/public/browser/download_manager.h" | 10 #include "content/public/browser/download_manager.h" |
11 | 11 |
12 class FilePath; | 12 class FilePath; |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class WebContents; | 15 class WebContents; |
16 } | 16 } |
17 | 17 |
18 // Handles showing a dialog to the user to ask for the filename for a download. | 18 // Handles showing a dialog to the user to ask for the filename for a download. |
19 class DownloadFilePicker : public content::DownloadManager::Observer, | 19 class DownloadFilePicker : public content::DownloadManager::Observer, |
20 public SelectFileDialog::Listener { | 20 public SelectFileDialog::Listener { |
21 public: | 21 public: |
22 DownloadFilePicker(content::DownloadManager* download_manager, | 22 DownloadFilePicker(content::DownloadManager* download_manager, |
23 content::WebContents* web_contents, | 23 content::WebContents* web_contents, |
24 const FilePath& suggested_path, | 24 const FilePath& suggested_path, |
25 void* params); | 25 int32 download_id); |
26 virtual ~DownloadFilePicker(); | 26 virtual ~DownloadFilePicker(); |
27 | 27 |
28 private: | 28 private: |
29 // content::DownloadManager::Observer implementation. | 29 // content::DownloadManager::Observer implementation. |
30 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 30 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
31 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; | 31 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; |
32 | 32 |
33 // SelectFileDialog::Listener implementation. | 33 // SelectFileDialog::Listener implementation. |
34 virtual void FileSelected(const FilePath& path, | 34 virtual void FileSelected(const FilePath& path, |
35 int index, | 35 int index, |
36 void* params) OVERRIDE; | 36 void* params) OVERRIDE; |
37 virtual void FileSelectionCanceled(void* params) OVERRIDE; | 37 virtual void FileSelectionCanceled(void* params) OVERRIDE; |
38 | 38 |
39 content::DownloadManager* download_manager_; | 39 content::DownloadManager* download_manager_; |
| 40 int32 download_id_; |
40 | 41 |
41 FilePath suggested_path_; | 42 FilePath suggested_path_; |
42 | 43 |
43 // For managing select file dialogs. | 44 // For managing select file dialogs. |
44 scoped_refptr<SelectFileDialog> select_file_dialog_; | 45 scoped_refptr<SelectFileDialog> select_file_dialog_; |
45 | 46 |
46 DISALLOW_COPY_AND_ASSIGN(DownloadFilePicker); | 47 DISALLOW_COPY_AND_ASSIGN(DownloadFilePicker); |
47 }; | 48 }; |
48 | 49 |
49 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ | 50 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ |
OLD | NEW |