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

Unified Diff: chrome/browser/download/download_extension_api.cc

Issue 9621007: Add new danger type for uncommon or unknown downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 9 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 | « no previous file | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_extension_api.cc
diff --git a/chrome/browser/download/download_extension_api.cc b/chrome/browser/download/download_extension_api.cc
index 264ab0d8d3c113d884dd5573ec0ecf82c5c646be..b80c320415743e9896dae358777b0c4c8394b91a 100644
--- a/chrome/browser/download/download_extension_api.cc
+++ b/chrome/browser/download/download_extension_api.cc
@@ -82,6 +82,7 @@ const char kDangerContent[] = "content";
const char kDangerFile[] = "file";
const char kDangerKey[] = "danger";
const char kDangerSafe[] = "safe";
+const char kDangerUncommon[] = "uncommon";
const char kDangerUrl[] = "url";
const char kEndTimeKey[] = "endTime";
const char kErrorKey[] = "error";
@@ -114,14 +115,21 @@ const char kTotalBytesLessKey[] = "totalBytesLess";
const char kUrlKey[] = "url";
const char kUrlRegexKey[] = "urlRegex";
+// Note: Any change to the danger type strings, should be accompanied by a
+// corresponding change to {experimental.}downloads.json.
const char* kDangerStrings[] = {
kDangerSafe,
kDangerFile,
kDangerUrl,
kDangerContent,
kDangerSafe,
+ kDangerUncommon,
};
+COMPILE_ASSERT(arraysize(kDangerStrings) == content::DOWNLOAD_DANGER_TYPE_MAX,
+ download_danger_type_enum_changed);
+// Note: Any change to the state strings, should be accompanied by a
+// corresponding change to {experimental.}downloads.json.
const char* kStateStrings[] = {
kStateInProgress,
kStateComplete,
@@ -129,6 +137,8 @@ const char* kStateStrings[] = {
NULL,
kStateInterrupted,
};
+COMPILE_ASSERT(arraysize(kStateStrings) == DownloadItem::MAX_DOWNLOAD_STATE,
+ download_item_state_enum_changed);
const char* DangerString(content::DownloadDangerType danger) {
DCHECK(danger >= 0);
« no previous file with comments | « no previous file | chrome/browser/download/download_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698