OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/download/download_manager.h" | 10 #include "content/browser/download/download_manager.h" |
11 | 11 |
12 class FilePath; | 12 class FilePath; |
13 class TabContents; | 13 class TabContents; |
14 | 14 |
15 // Handles showing a dialog to the user to ask for the filename for a download. | 15 // Handles showing a dialog to the user to ask for the filename for a download. |
16 class DownloadFilePicker : public DownloadManager::Observer, | 16 class DownloadFilePicker : public DownloadManager::Observer, |
17 public SelectFileDialog::Listener { | 17 public SelectFileDialog::Listener { |
18 public: | 18 public: |
19 DownloadFilePicker(DownloadManager* download_manager, | 19 DownloadFilePicker(DownloadManager* download_manager, |
20 TabContents* tab_contents, | 20 TabContents* tab_contents, |
21 const FilePath& suggested_path, | 21 const FilePath& suggested_path, |
22 void* params); | 22 void* params); |
23 virtual ~DownloadFilePicker(); | 23 virtual ~DownloadFilePicker(); |
24 | 24 |
25 private: | 25 private: |
26 // DownloadManager::Observer implementation. | 26 // DownloadManager::Observer implementation. |
27 virtual void ModelChanged(); | 27 virtual void ModelChanged() OVERRIDE; |
28 virtual void ManagerGoingDown(); | 28 virtual void ManagerGoingDown() OVERRIDE; |
29 | 29 |
30 // SelectFileDialog::Listener implementation. | 30 // SelectFileDialog::Listener implementation. |
31 virtual void FileSelected(const FilePath& path, int index, void* params); | 31 virtual void FileSelected(const FilePath& path, |
32 virtual void FileSelectionCanceled(void* params); | 32 int index, |
| 33 void* params) OVERRIDE; |
| 34 virtual void FileSelectionCanceled(void* params) OVERRIDE; |
33 | 35 |
34 DownloadManager* download_manager_; | 36 DownloadManager* download_manager_; |
35 | 37 |
36 // For managing select file dialogs. | 38 // For managing select file dialogs. |
37 scoped_refptr<SelectFileDialog> select_file_dialog_; | 39 scoped_refptr<SelectFileDialog> select_file_dialog_; |
38 | 40 |
39 DISALLOW_COPY_AND_ASSIGN(DownloadFilePicker); | 41 DISALLOW_COPY_AND_ASSIGN(DownloadFilePicker); |
40 }; | 42 }; |
41 | 43 |
42 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ | 44 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ |
OLD | NEW |