default_user_image.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2022 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 ASH_PUBLIC_CPP_DEFAULT_USER_IMAGE_H_
  5. #define ASH_PUBLIC_CPP_DEFAULT_USER_IMAGE_H_
  6. #include <string>
  7. #include "ash/public/cpp/ash_public_export.h"
  8. #include "third_party/abseil-cpp/absl/types/optional.h"
  9. #include "url/gurl.h"
  10. namespace ash::default_user_image {
  11. // Only relevant for a few deprecated avatar images that users can no longer
  12. // select.
  13. struct ASH_PUBLIC_EXPORT DeprecatedSourceInfo {
  14. public:
  15. DeprecatedSourceInfo();
  16. DeprecatedSourceInfo(std::u16string author, GURL website);
  17. DeprecatedSourceInfo(DeprecatedSourceInfo&&);
  18. DeprecatedSourceInfo& operator=(DeprecatedSourceInfo&&);
  19. DeprecatedSourceInfo(const DeprecatedSourceInfo&) = delete;
  20. DeprecatedSourceInfo& operator=(const DeprecatedSourceInfo&) = delete;
  21. ~DeprecatedSourceInfo();
  22. std::u16string author;
  23. GURL website;
  24. };
  25. struct ASH_PUBLIC_EXPORT DefaultUserImage {
  26. public:
  27. DefaultUserImage();
  28. DefaultUserImage(int index,
  29. std::u16string title,
  30. GURL url,
  31. absl::optional<DeprecatedSourceInfo> source_info);
  32. DefaultUserImage(DefaultUserImage&&);
  33. DefaultUserImage& operator=(DefaultUserImage&&);
  34. DefaultUserImage(const DefaultUserImage&) = delete;
  35. DefaultUserImage& operator=(const DefaultUserImage&) = delete;
  36. ~DefaultUserImage();
  37. int index;
  38. std::u16string title;
  39. GURL url;
  40. // Deprecated. Only used for older avatar images that users can no longer
  41. // select.
  42. absl::optional<DeprecatedSourceInfo> source_info;
  43. };
  44. } // namespace ash::default_user_image
  45. #endif // ASH_PUBLIC_CPP_DEFAULT_USER_IMAGE_H_