camera_roll_item.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2021 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_COMPONENTS_PHONEHUB_CAMERA_ROLL_ITEM_H_
  5. #define ASH_COMPONENTS_PHONEHUB_CAMERA_ROLL_ITEM_H_
  6. #include "ash/components/phonehub/proto/phonehub_api.pb.h"
  7. #include "ui/gfx/image/image.h"
  8. namespace ash {
  9. namespace phonehub {
  10. // Data related to a photo or video taken on an Android device, including
  11. // metadata and thumbnail.
  12. class CameraRollItem {
  13. public:
  14. CameraRollItem(const proto::CameraRollItemMetadata& metadata,
  15. const gfx::Image& thumbnail);
  16. CameraRollItem(const CameraRollItem&);
  17. CameraRollItem& operator=(const CameraRollItem&);
  18. virtual ~CameraRollItem();
  19. // True iff both both items have the same metadata values.
  20. bool operator==(const CameraRollItem& other) const;
  21. bool operator!=(const CameraRollItem& other) const;
  22. // Returns the metadata of this item.
  23. const proto::CameraRollItemMetadata& metadata() const { return metadata_; }
  24. // Returns the decoded thumbnail of this item.
  25. const gfx::Image& thumbnail() const { return thumbnail_; }
  26. private:
  27. proto::CameraRollItemMetadata metadata_;
  28. gfx::Image thumbnail_;
  29. };
  30. } // namespace phonehub
  31. } // namespace ash
  32. // TODO(https://crbug.com/1164001): remove after the migration is finished.
  33. namespace chromeos {
  34. namespace phonehub {
  35. using ::ash::phonehub::CameraRollItem;
  36. }
  37. } // namespace chromeos
  38. #endif // ASH_COMPONENTS_PHONEHUB_CAMERA_ROLL_ITEM_H_