| Index: chrome/browser/download/download_file_picker.h
|
| diff --git a/chrome/browser/download/download_file_picker.h b/chrome/browser/download/download_file_picker.h
|
| index b7dc8b42f4c78cb1f277fa33b551f4cb805cb582..32fb1edf4705e30686900d2320d17552429bda70 100644
|
| --- a/chrome/browser/download/download_file_picker.h
|
| +++ b/chrome/browser/download/download_file_picker.h
|
| @@ -5,7 +5,7 @@
|
| #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_
|
| #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_
|
|
|
| -#include "chrome/browser/download/chrome_download_manager_delegate.h"
|
| +#include "base/callback.h"
|
| #include "ui/shell_dialogs/select_file_dialog.h"
|
|
|
| namespace base {
|
| @@ -21,16 +21,23 @@ class WebContents;
|
| // Handles showing a dialog to the user to ask for the filename for a download.
|
| class DownloadFilePicker : public ui::SelectFileDialog::Listener {
|
| public:
|
| - DownloadFilePicker();
|
| - virtual ~DownloadFilePicker();
|
| + // Callback used to pass the selected path back to the owner of this
|
| + // object. The callback will be invoked with the user-selected path as the
|
| + // argument. If the file selection is canceled, the argument will be the empty
|
| + // path.
|
| + typedef base::Callback<void(const base::FilePath&,
|
| + const base::FilePath&)> FileSelectedCallback;
|
|
|
| - void Init(content::DownloadManager* download_manager,
|
| - content::DownloadItem* item,
|
| - const base::FilePath& suggested_path,
|
| - const ChromeDownloadManagerDelegate::FileSelectedCallback&
|
| - callback);
|
| + static void ShowFilePicker(content::DownloadItem* item,
|
| + const base::FilePath& suggested_path,
|
| + const FileSelectedCallback& callback);
|
|
|
| protected:
|
| + DownloadFilePicker(content::DownloadItem* item,
|
| + const base::FilePath& suggested_path,
|
| + const FileSelectedCallback& callback);
|
| + virtual ~DownloadFilePicker();
|
| +
|
| // On ChromeOS |suggested_path| might be a temporary local filename. This
|
| // method should be overridden to set the correct suggested path to prompt the
|
| // user.
|
| @@ -41,8 +48,10 @@ class DownloadFilePicker : public ui::SelectFileDialog::Listener {
|
| suggested_path_ = suggested_path;
|
| }
|
|
|
| - // Runs |file_selected_callback_| with |path| and then deletes this object.
|
| - void OnFileSelected(const base::FilePath& path);
|
| + // Runs |file_selected_callback_| with |virtual_path| and |local_path| and
|
| + // then deletes this object.
|
| + void OnFileSelected(const base::FilePath& virtual_path,
|
| + const base::FilePath& local_path);
|
|
|
| void RecordFileSelected(const base::FilePath& path);
|
|
|
| @@ -58,7 +67,7 @@ class DownloadFilePicker : public ui::SelectFileDialog::Listener {
|
|
|
| base::FilePath suggested_path_;
|
|
|
| - ChromeDownloadManagerDelegate::FileSelectedCallback file_selected_callback_;
|
| + FileSelectedCallback file_selected_callback_;
|
|
|
| // For managing select file dialogs.
|
| scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
|
|
|