| Index: chrome/browser/download/download_manager.h
|
| diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
|
| index e072d42498fcd2310388d3f879e2b1c0f4798f8d..4a5814bb62ea33c4bdc98b1dfec2d2222f197eaf 100644
|
| --- a/chrome/browser/download/download_manager.h
|
| +++ b/chrome/browser/download/download_manager.h
|
| @@ -86,7 +86,9 @@ class DownloadManager
|
| // Called immediately after the DownloadManager puts up a select file
|
| // dialog.
|
| // |id| indicates which download opened the dialog.
|
| - virtual void SelectFileDialogDisplayed(int32 id) {}
|
| + // |suggested_path| indicates the path suggested in the dialog.
|
| + virtual void SelectFileDialogDisplayed(
|
| + int32 id, const FilePath& suggested_path) {}
|
|
|
| protected:
|
| virtual ~Observer() {}
|
| @@ -251,6 +253,17 @@ class DownloadManager
|
| // For debugging.
|
| void AssertNotInQueues(DownloadItem* download);
|
|
|
| + // Chooses a writable directory from |website_save_dir|, |download_save_dir|
|
| + // and |default_download_dir| in this order of priority.
|
| + // If none of them is writable, creates |download_save_dir| and
|
| + // chooses |download_save_dir|. The choosed directory is stored to |save_dir|.
|
| + // Returns true if neither |website_save_dir| nor |download_save_dir|
|
| + // is writable, which indicates the select file dialog should be displayed.
|
| + static bool ChooseSavableDirectory(const FilePath& website_save_dir,
|
| + const FilePath& download_save_dir,
|
| + const FilePath& default_download_dir,
|
| + FilePath* save_dir);
|
| +
|
| private:
|
| // For testing.
|
| friend class DownloadManagerTest;
|
| @@ -288,7 +301,8 @@ class DownloadManager
|
| // stalls from interacting with the file system.
|
| void CheckIfSuggestedPathExists(int32 download_id,
|
| DownloadStateInfo state,
|
| - const FilePath& default_path);
|
| + const FilePath& download_save_dir,
|
| + const FilePath& default_download_dir);
|
|
|
| // Called on the UI thread once the DownloadManager has determined whether the
|
| // suggested file path exists.
|
|
|