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

Unified Diff: components/history/core/browser/download_constants.cc

Issue 833033002: Remove dependency on //content from history DownloadDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests and move download_database.{cc,h} Created 5 years, 11 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
Index: components/history/core/browser/download_constants.cc
diff --git a/components/history/core/browser/download_constants.cc b/components/history/core/browser/download_constants.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f89dac6a0e9ca536f09481ef0de1f14d493c5461
--- /dev/null
+++ b/components/history/core/browser/download_constants.cc
@@ -0,0 +1,62 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/history/core/browser/download_constants.h"
+
+#include "base/logging.h"
+
+namespace history {
+
+const DownloadState kStateInvalid = -1;
+const DownloadState kStateInProgress = 0;
+const DownloadState kStateComplete = 1;
+const DownloadState kStateCancelled = 2;
+const DownloadState kStateBug140687 = 3;
+const DownloadState kStateInterrupted = 4;
+
+DownloadState IntToDownloadState(int state) {
+ switch (state) {
+ case kStateInProgress:
+ case kStateComplete:
+ case kStateCancelled:
+ case kStateInterrupted:
+ return static_cast<DownloadState>(state);
+ default:
+ NOTREACHED();
+ return kStateInvalid;
+ }
+}
+
+const DownloadDangerType kDangerTypeInvalid = -1;
+const DownloadDangerType kDangerTypeNotDangerous = 0;
+const DownloadDangerType kDangerTypeDangerousFile = 1;
+const DownloadDangerType kDangerTypeDangerousUrl = 2;
+const DownloadDangerType kDangerTypeDangerousContent = 3;
+const DownloadDangerType kDangerTypeMaybeDangerousContent = 4;
+const DownloadDangerType kDangerTypeUncommonContent = 5;
+const DownloadDangerType kDangerTypeUserValidated = 6;
+const DownloadDangerType kDangerTypeDangerousHost = 7;
+const DownloadDangerType kDangerTypePotentiallyUnwanted = 8;
+
+DownloadDangerType IntToDownloadDangerType(int state) {
+ switch (state) {
+ case kDangerTypeNotDangerous:
+ case kDangerTypeDangerousFile:
+ case kDangerTypeDangerousUrl:
+ case kDangerTypeDangerousContent:
+ case kDangerTypeMaybeDangerousContent:
+ case kDangerTypeUncommonContent:
+ case kDangerTypeUserValidated:
+ case kDangerTypeDangerousHost:
+ case kDangerTypePotentiallyUnwanted:
+ return static_cast<DownloadState>(state);
+ default:
+ NOTREACHED();
+ return kDangerTypeInvalid;
+ }
+}
+
+const DownloadId kInvalidDownloadId = 0;
+
+} // namespace history

Powered by Google App Engine
This is Rietveld 408576698