Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1611)

Unified Diff: chrome/browser/download/download_file_picker.h

Issue 10704052: Download filename determination refactor (3/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with r148594 to and resolve conflicts with r148576 Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_file_picker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 011eaeaafe7cd943ca65261aadc7583dfa34bf2d..a7ea2a01e3a0939709f03d451d06d63687366b02 100644
--- a/chrome/browser/download/download_file_picker.h
+++ b/chrome/browser/download/download_file_picker.h
@@ -5,6 +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 "chrome/browser/ui/select_file_dialog.h"
class FilePath;
@@ -22,15 +23,25 @@ class DownloadFilePicker : public SelectFileDialog::Listener {
virtual ~DownloadFilePicker();
void Init(content::DownloadManager* download_manager,
- content::DownloadItem* item);
+ content::DownloadItem* item,
+ const FilePath& suggested_path,
+ const ChromeDownloadManagerDelegate::FileSelectedCallback&
+ callback);
protected:
- // On ChromeOS, DownloadItem::GetTargetPath is a temporary local filename.
- virtual void InitSuggestedPath(content::DownloadItem* item);
+ // 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.
+ virtual void InitSuggestedPath(content::DownloadItem* item,
+ const FilePath& suggested_path);
+
void set_suggested_path(const FilePath& suggested_path) {
suggested_path_ = suggested_path;
}
+ // Runs |file_selected_callback_| with |path| and then deletes this object.
+ void OnFileSelected(const FilePath& path);
+
void RecordFileSelected(const FilePath& path);
scoped_refptr<content::DownloadManager> download_manager_;
@@ -45,6 +56,8 @@ class DownloadFilePicker : public SelectFileDialog::Listener {
FilePath suggested_path_;
+ ChromeDownloadManagerDelegate::FileSelectedCallback file_selected_callback_;
+
// For managing select file dialogs.
scoped_refptr<SelectFileDialog> select_file_dialog_;
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_file_picker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698