#ifndef ASH_AMBIENT_MODEL_AMBIENT_ANIMATION_ATTRIBUTION_PROVIDER_H_
#define ASH_AMBIENT_MODEL_AMBIENT_ANIMATION_ATTRIBUTION_PROVIDER_H_
#include <vector>
#include "ash/ambient/model/ambient_animation_photo_provider.h"
#include "ash/ash_export.h"
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "cc/paint/skottie_resource_metadata.h"
namespace lottie {
class Animation;
}
namespace ash {
class ASH_EXPORT AmbientAnimationAttributionProvider
: public AmbientAnimationPhotoProvider::Observer {
public:
AmbientAnimationAttributionProvider(
AmbientAnimationPhotoProvider* photo_provider,
lottie::Animation* animation);
AmbientAnimationAttributionProvider(
const AmbientAnimationAttributionProvider&) = delete;
AmbientAnimationAttributionProvider& operator=(
const AmbientAnimationAttributionProvider&) = delete;
~AmbientAnimationAttributionProvider() override;
void OnDynamicImageAssetsRefreshed(
const base::flat_map<ambient::util::ParsedDynamicAssetId,
std::reference_wrapper<const PhotoWithDetails>>&
new_topics) override;
private:
const raw_ptr<lottie::Animation> animation_;
const std::vector<cc::SkottieResourceIdHash> attribution_node_ids_;
base::ScopedObservation<AmbientAnimationPhotoProvider,
AmbientAnimationPhotoProvider::Observer>
observation_{this};
};
}
#endif