OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_HISTORY_CONTENT_BROWSER_DOWNLOAD_CONSTANTS_UTILS_H_ |
| 6 #define COMPONENTS_HISTORY_CONTENT_BROWSER_DOWNLOAD_CONSTANTS_UTILS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/history/core/browser/download_types.h" |
| 11 #include "content/public/browser/download_danger_type.h" |
| 12 #include "content/public/browser/download_interrupt_reasons.h" |
| 13 #include "content/public/browser/download_item.h" |
| 14 |
| 15 namespace history { |
| 16 |
| 17 // Utility functions to convert between content::DownloadItem::DownloadState |
| 18 // enumeration and history::DownloadState constants. |
| 19 content::DownloadItem::DownloadState ToContentDownloadState( |
| 20 DownloadState state); |
| 21 DownloadState ToHistoryDownloadState( |
| 22 content::DownloadItem::DownloadState state); |
| 23 |
| 24 // Utility functions to convert between content::DownloadDangerType enumeration |
| 25 // and history::DownloadDangerType constants. |
| 26 content::DownloadDangerType ToContentDownloadDangerType( |
| 27 DownloadDangerType danger_type); |
| 28 DownloadDangerType ToHistoryDownloadDangerType( |
| 29 content::DownloadDangerType danger_type); |
| 30 |
| 31 // Utility functions to convert between content::DownloadInterrupReason |
| 32 // enumeration and history::DownloadInterruptReason type (value have no |
| 33 // meaning in history, but have a different type to avoid bugs due to |
| 34 // implicit conversions). |
| 35 content::DownloadInterruptReason ToContentDownloadInterruptReason( |
| 36 DownloadInterruptReason interrupt_reason); |
| 37 DownloadInterruptReason ToHistoryDownloadInterruptReason( |
| 38 content::DownloadInterruptReason interrupt_reason); |
| 39 |
| 40 // Utility functions to convert between content download id values and |
| 41 // history::DownloadId type (value have no meaning in history, except |
| 42 // for kInvalidDownloadId). |
| 43 uint32 ToContentDownloadId(DownloadId id); |
| 44 DownloadId ToHistoryDownloadId(uint32 id); |
| 45 } // namespace history |
| 46 |
| 47 #endif // COMPONENTS_HISTORY_CONTENT_BROWSER_DOWNLOAD_CONSTANTS_UTILS_H_ |
OLD | NEW |