OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TARGET_DETERMINER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_DELEGATE_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_DELEGATE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 | 9 |
10 #include "chrome/browser/download/download_path_reservation_tracker.h" | 10 #include "chrome/browser/download/download_path_reservation_tracker.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Notifies extensions of the impending filename determination. |virtual_path| | 65 // Notifies extensions of the impending filename determination. |virtual_path| |
66 // is the current suggested virtual path. The |callback| should be invoked to | 66 // is the current suggested virtual path. The |callback| should be invoked to |
67 // indicate whether any extensions wish to override the path. | 67 // indicate whether any extensions wish to override the path. |
68 virtual void NotifyExtensions(content::DownloadItem* download, | 68 virtual void NotifyExtensions(content::DownloadItem* download, |
69 const base::FilePath& virtual_path, | 69 const base::FilePath& virtual_path, |
70 const NotifyExtensionsCallback& callback) = 0; | 70 const NotifyExtensionsCallback& callback) = 0; |
71 | 71 |
72 // Reserve |virtual_path|. This is expected to check the following: | 72 // Reserve |virtual_path|. This is expected to check the following: |
73 // - Whether |virtual_path| can be written to by the user. If not, the | 73 // - Whether |virtual_path| can be written to by the user. If not, the |
74 // |virtual_path| can be changed to writeable path if necessary. | 74 // |virtual_path| can be changed to writeable path if necessary. |
75 // - If |conflict_action| is UNIQUIFY then |virtual_path| should be modified | 75 // - If |conflict_action| is UNIQUIFY then |virtual_path| should be |
76 // so that the new path is writeable and unique. | 76 // modified so that the new path is writeable and unique. If |
| 77 // |conflict_action| is PROMPT, then in the event of a conflict, |
| 78 // |callback| should be invoked with |success| set to |false| in |
| 79 // order to force a prompt. |virtual_path| may or may not be |
| 80 // modified in the latter case. |
| 81 // - If |create_directory| is true, then the parent directory of |
| 82 // |virtual_path| should be created if it doesn't exist. |
77 // | 83 // |
78 // |callback| should be invoked on completion with the results. | 84 // |callback| should be invoked on completion with the results. |
79 virtual void ReserveVirtualPath( | 85 virtual void ReserveVirtualPath( |
80 content::DownloadItem* download, | 86 content::DownloadItem* download, |
81 const base::FilePath& virtual_path, | 87 const base::FilePath& virtual_path, |
82 bool create_directory, | 88 bool create_directory, |
83 DownloadPathReservationTracker::FilenameConflictAction conflict_action, | 89 DownloadPathReservationTracker::FilenameConflictAction conflict_action, |
84 const ReservedPathCallback& callback) = 0; | 90 const ReservedPathCallback& callback) = 0; |
85 | 91 |
86 // Display a prompt to the user requesting that a download target be chosen. | 92 // Display a prompt to the user requesting that a download target be chosen. |
(...skipping 15 matching lines...) Expand all Loading... |
102 // suggested danger type for the download. | 108 // suggested danger type for the download. |
103 virtual void CheckDownloadUrl(content::DownloadItem* download, | 109 virtual void CheckDownloadUrl(content::DownloadItem* download, |
104 const base::FilePath& virtual_path, | 110 const base::FilePath& virtual_path, |
105 const CheckDownloadUrlCallback& callback) = 0; | 111 const CheckDownloadUrlCallback& callback) = 0; |
106 | 112 |
107 protected: | 113 protected: |
108 virtual ~DownloadTargetDeterminerDelegate(); | 114 virtual ~DownloadTargetDeterminerDelegate(); |
109 }; | 115 }; |
110 | 116 |
111 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_DELEGATE_H_ | 117 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_DELEGATE_H_ |
OLD | NEW |