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