Index: chrome/browser/download/chrome_download_manager_delegate.h |
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h |
index eb4150d0ee37ba20fb94cba575abe0256124c0a5..a9a081a4d1150d5c2f4c4c73e2a0a9ef9125be0c 100644 |
--- a/chrome/browser/download/chrome_download_manager_delegate.h |
+++ b/chrome/browser/download/chrome_download_manager_delegate.h |
@@ -19,7 +19,6 @@ |
#include "content/public/browser/notification_registrar.h" |
class DownloadPrefs; |
-class ExtensionDownloadsEventRouter; |
class PrefRegistrySyncable; |
class Profile; |
@@ -145,6 +144,8 @@ class ChromeDownloadManagerDelegate |
private: |
friend class base::RefCountedThreadSafe<ChromeDownloadManagerDelegate>; |
+ struct ContinueFilenameDeterminationInfo; |
+ |
// content::NotificationObserver implementation. |
virtual void Observe(int type, |
const content::NotificationSource& source, |
@@ -198,6 +199,22 @@ class ChromeDownloadManagerDelegate |
const base::FilePath& reserved_path, |
bool reserved_path_verified); |
+ // When an extension opts to change a download's target filename, this |
+ // sanitizes it before continuing with the filename determination process. |
+ void OnExtensionOverridingFilename( |
+ const ContinueFilenameDeterminationInfo& continue_info, |
+ const base::FilePath& changed_filename, |
+ bool overwrite); |
+ |
+ // When extensions either opt not to change a download's target filename, or |
+ // the changed filename has been sanitized, this method continues with the |
+ // filename determination process, optionally prompting the user to manually |
+ // set the filename. |
+ void ContinueDeterminingFilename( |
+ const ContinueFilenameDeterminationInfo& continue_info, |
+ const base::FilePath& suggested_path, |
+ bool is_forced_path); |
+ |
// Called on the UI thread once the final target path is available. |
void OnTargetPathDetermined( |
int32 download_id, |
@@ -227,20 +244,6 @@ class ChromeDownloadManagerDelegate |
content::NotificationRegistrar registrar_; |
- // On Android, GET downloads are not handled by the DownloadManager. |
- // Once we have extensions on android, we probably need the EventRouter |
- // in ContentViewDownloadDelegate which knows about both GET and POST |
- // downloads. |
-#if !defined(OS_ANDROID) |
- // The ExtensionDownloadsEventRouter dispatches download creation, change, and |
- // erase events to extensions. Like ChromeDownloadManagerDelegate, it's a |
- // chrome-level concept and its lifetime should match DownloadManager. There |
- // should be a separate EDER for on-record and off-record managers. |
- // There does not appear to be a separate ExtensionSystem for on-record and |
- // off-record profiles, so ExtensionSystem cannot own the EDER. |
- scoped_ptr<ExtensionDownloadsEventRouter> extension_event_router_; |
-#endif |
- |
// The directory most recently chosen by the user in response to a Save As |
// dialog for a regular download. |
base::FilePath last_download_path_; |