#ifndef ASH_SYSTEM_PRIVACY_SCREEN_SECURITY_CONTROLLER_H_
#define ASH_SYSTEM_PRIVACY_SCREEN_SECURITY_CONTROLLER_H_
#include <string>
#include <vector>
#include "ash/shell_observer.h"
#include "ash/system/privacy/screen_security_observer.h"
#include "base/memory/weak_ptr.h"
namespace ash {
extern ASH_EXPORT const char kScreenAccessNotificationId[];
extern ASH_EXPORT const char kRemotingScreenShareNotificationId[];
extern ASH_EXPORT const char kNotifierScreenAccess[];
extern ASH_EXPORT const char kNotifierRemotingScreenShare[];
class ASH_EXPORT ScreenSecurityController : public ScreenSecurityObserver,
public ShellObserver {
public:
ScreenSecurityController();
ScreenSecurityController(const ScreenSecurityController&) = delete;
ScreenSecurityController& operator=(const ScreenSecurityController&) = delete;
~ScreenSecurityController() override;
void StopAllSessions(bool is_screen_access);
private:
void CreateNotification(const std::u16string& message,
bool is_screen_access_notification);
void ChangeSource();
void OnScreenAccessStart(base::OnceClosure stop_callback,
const base::RepeatingClosure& source_callback,
const std::u16string& access_app_name) override;
void OnScreenAccessStop() override;
void OnRemotingScreenShareStart(base::OnceClosure stop_callback) override;
void OnRemotingScreenShareStop() override;
void OnCastingSessionStartedOrStopped(bool started) override;
bool is_casting_ = false;
std::vector<base::OnceClosure> screen_access_stop_callbacks_;
std::vector<base::OnceClosure> remoting_share_stop_callbacks_;
base::RepeatingClosure change_source_callback_;
base::WeakPtrFactory<ScreenSecurityController> weak_ptr_factory_{this};
};
}
#endif