Index: chrome/browser/extensions/api/downloads/downloads_api.h |
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.h b/chrome/browser/extensions/api/downloads/downloads_api.h |
index 59abe29da000be43b8ffe27fa4237a2db8dde225..c6ed808b2fc9265f0e4dba353052cc291ecd378c 100644 |
--- a/chrome/browser/extensions/api/downloads/downloads_api.h |
+++ b/chrome/browser/extensions/api/downloads/downloads_api.h |
@@ -12,6 +12,7 @@ |
#include "base/strings/string16.h" |
#include "base/values.h" |
#include "chrome/browser/download/all_download_item_notifier.h" |
+#include "chrome/browser/download/download_danger_prompt.h" |
#include "chrome/browser/download/download_path_reservation_tracker.h" |
#include "chrome/browser/extensions/event_router.h" |
#include "chrome/browser/extensions/extension_function.h" |
@@ -35,16 +36,17 @@ class ResourceDispatcherHost; |
namespace download_extension_errors { |
// Errors that can be returned through chrome.runtime.lastError.message. |
-extern const char kGenericError[]; |
extern const char kIconNotFoundError[]; |
extern const char kInvalidDangerTypeError[]; |
extern const char kInvalidFilenameError[]; |
extern const char kInvalidFilterError[]; |
+extern const char kInvalidHeaderError[]; |
extern const char kInvalidOperationError[]; |
extern const char kInvalidOrderByError[]; |
extern const char kInvalidQueryLimit[]; |
extern const char kInvalidStateError[]; |
extern const char kInvalidURLError[]; |
+extern const char kNotPermittedURLError[]; |
extern const char kNotImplementedError[]; |
extern const char kTooManyListenersError[]; |
@@ -61,7 +63,12 @@ class DownloadsDownloadFunction : public AsyncExtensionFunction { |
virtual ~DownloadsDownloadFunction(); |
private: |
- void OnStarted(content::DownloadItem* item, net::Error error); |
+ void OnStarted( |
+ const base::FilePath& creator_suggested_filename, |
+ extensions::api::downloads::FilenameConflictAction |
+ creator_conflict_action, |
+ content::DownloadItem* item, |
+ net::Error error); |
DISALLOW_COPY_AND_ASSIGN(DownloadsDownloadFunction); |
}; |
@@ -131,6 +138,21 @@ class DownloadsEraseFunction : public SyncExtensionFunction { |
DISALLOW_COPY_AND_ASSIGN(DownloadsEraseFunction); |
}; |
+class DownloadsDeleteFileFunction : public AsyncExtensionFunction { |
+ public: |
+ DECLARE_EXTENSION_FUNCTION("downloads.deleteFile", DOWNLOADS_DELETEFILE) |
+ DownloadsDeleteFileFunction(); |
+ virtual bool RunImpl() OVERRIDE; |
+ |
+ protected: |
+ virtual ~DownloadsDeleteFileFunction(); |
+ |
+ private: |
+ void DeleteOnFileThread(const base::FilePath& path); |
+ void RespondOnUIThread(); |
+ DISALLOW_COPY_AND_ASSIGN(DownloadsDeleteFileFunction); |
+}; |
+ |
class DownloadsAcceptDangerFunction : public AsyncExtensionFunction { |
public: |
DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER) |
@@ -139,7 +161,8 @@ class DownloadsAcceptDangerFunction : public AsyncExtensionFunction { |
protected: |
virtual ~DownloadsAcceptDangerFunction(); |
- void DangerPromptCallback(bool accept, int download_id); |
+ void DangerPromptCallback(int download_id, |
+ DownloadDangerPrompt::Action action); |
private: |
DISALLOW_COPY_AND_ASSIGN(DownloadsAcceptDangerFunction); |
@@ -184,6 +207,20 @@ class DownloadsDragFunction : public AsyncExtensionFunction { |
DISALLOW_COPY_AND_ASSIGN(DownloadsDragFunction); |
}; |
+class DownloadsSetShelfVisibleFunction : public SyncExtensionFunction { |
+ public: |
+ DECLARE_EXTENSION_FUNCTION("downloads.setShelfVisible", |
+ DOWNLOADS_SETSHELFVISIBLE) |
+ DownloadsSetShelfVisibleFunction(); |
+ virtual bool RunImpl() OVERRIDE; |
+ |
+ protected: |
+ virtual ~DownloadsSetShelfVisibleFunction(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(DownloadsSetShelfVisibleFunction); |
+}; |
+ |
class DownloadsGetFileIconFunction : public AsyncExtensionFunction { |
public: |
DECLARE_EXTENSION_FUNCTION("downloads.getFileIcon", DOWNLOADS_GETFILEICON) |