download_namespace.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2018 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. #ifndef COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_NAMESPACE_H_
  5. #define COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_NAMESPACE_H_
  6. #include <string>
  7. namespace download {
  8. // The namespace of the download, used for classifying the download.
  9. // Entries in this enum can only be appended instead of being deleted or reused.
  10. enum class DownloadNamespace {
  11. NAMESPACE_UNKNOWN = 0,
  12. // Regular browser downloads, either through context menu or navigation.
  13. NAMESPACE_BROWSER_DOWNLOAD,
  14. };
  15. // Converts a namespace to its string representation.
  16. std::string DownloadNamespaceToString(DownloadNamespace download_namespace);
  17. // Converts a string representation of a namespace to its namespace, or
  18. // NAMESPACE_UNKNOWN if the string doesn't map to one.
  19. DownloadNamespace DownloadNamespaceFromString(
  20. const std::string& namespace_string);
  21. } // namespace download
  22. #endif // COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_NAMESPACE_H_