#ifndef ASH_ANNOTATOR_ANNOTATION_SOURCE_WATCHER_H_
#define ASH_ANNOTATOR_ANNOTATION_SOURCE_WATCHER_H_
#include "ash/capture_mode/capture_mode_controller.h"
#include "ash/capture_mode/capture_mode_observer.h"
#include "ash/public/cpp/projector/projector_session.h"
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
namespace aura {
class Window;
}
namespace gfx {
class ImageSkia;
}
namespace ash {
class AnnotatorController;
class ASH_EXPORT AnnotationSourceWatcher : public CaptureModeObserver,
public ProjectorSessionObserver {
public:
explicit AnnotationSourceWatcher(AnnotatorController* annotator_controller);
AnnotationSourceWatcher(const AnnotationSourceWatcher&) = delete;
AnnotationSourceWatcher& operator=(const AnnotationSourceWatcher&) = delete;
~AnnotationSourceWatcher() override;
void NotifyMarkerEnabled(aura::Window* current_root);
void NotifyMarkerDisabled();
void OnRecordingStarted(aura::Window* current_root) override;
void OnRecordingEnded() override;
void OnVideoFileFinalized(bool user_deleted_video_file,
const gfx::ImageSkia& thumbnail) override;
void OnRecordedWindowChangingRoot(aura::Window* new_root) override;
void OnRecordingStartAborted() override;
void OnProjectorSessionActiveStateChanged(bool active) override;
private:
raw_ptr<AnnotatorController> annotator_controller_ = nullptr;
raw_ptr<CaptureModeController> capture_mode_controller_ = nullptr;
bool is_projector_session_active_ = false;
base::ScopedObservation<CaptureModeController, CaptureModeObserver>
capture_mode_observation_{this};
base::ScopedObservation<ProjectorSession, ProjectorSessionObserver>
projector_session_observation_{this};
};
}
#endif