Index: components/history/content/browser/download_constants_utils.h |
diff --git a/components/history/content/browser/download_constants_utils.h b/components/history/content/browser/download_constants_utils.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a6cc0fa3b192d1b822cb4949e8ac196d284fe615 |
--- /dev/null |
+++ b/components/history/content/browser/download_constants_utils.h |
@@ -0,0 +1,43 @@ |
+// 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. |
+ |
+#ifndef COMPONENTS_HISTORY_CONTENT_BROWSER_DOWNLOAD_CONSTANTS_UTILS_H_ |
+#define COMPONENTS_HISTORY_CONTENT_BROWSER_DOWNLOAD_CONSTANTS_UTILS_H_ |
+ |
+#include <string> |
+ |
+#include "components/history/core/browser/download_constants.h" |
+#include "components/history/core/browser/download_types.h" |
+#include "content/public/browser/download_danger_type.h" |
+#include "content/public/browser/download_interrupt_reasons.h" |
+#include "content/public/browser/download_item.h" |
+ |
+namespace history { |
+ |
+// Utility functions to convert between content::DownloadItem::DownloadState |
+// enumeration and history::DownloadState constants. |
+content::DownloadItem::DownloadState ToContentDownloadState( |
+ DownloadState state); |
+DownloadState ToHistoryDownloadState( |
+ content::DownloadItem::DownloadState state); |
+ |
+// Utility functions to convert between content::DownloadDangerType enumeration |
+// and history::DownloadDangerType constants. |
+content::DownloadDangerType ToContentDownloadDangerType( |
+ DownloadDangerType danger_type); |
+DownloadDangerType ToHistoryDownloadDangerType( |
+ content::DownloadDangerType danger_type); |
+ |
+// Utility functions to convert between content::DownloadInterrupReason |
+// enumeration and history::DownloadInterruptReason type (value have no |
+// meaning in history, but have a different type to avoid bugs due to |
+// implicit conversions). |
+content::DownloadInterruptReason ToContentDownloadInterruptReason( |
+ DownloadInterruptReason interrupt_reason); |
+DownloadInterruptReason ToHistoryDownloadInterruptReason( |
+ content::DownloadInterruptReason interrupt_reason); |
+ |
+} |
+ |
+#endif // COMPONENTS_HISTORY_CONTENT_BROWSER_DOWNLOAD_CONSTANTS_UTILS_H_ |