#ifndef ASH_SYSTEM_PRIVACY_HUB_PRIVACY_HUB_CONTROLLER_H_
#define ASH_SYSTEM_PRIVACY_HUB_PRIVACY_HUB_CONTROLLER_H_
#include "ash/ash_export.h"
#include "ash/constants/geolocation_access_level.h"
#include "ash/public/cpp/privacy_hub_delegate.h"
#include "ash/system/privacy_hub/camera_privacy_switch_controller.h"
#include "ash/system/privacy_hub/geolocation_privacy_switch_controller.h"
#include "ash/system/privacy_hub/microphone_privacy_switch_controller.h"
#include "ash/system/privacy_hub/speak_on_mute_detection_privacy_switch_controller.h"
#include "base/memory/raw_ptr.h"
#include "base/types/pass_key.h"
#include "base/values.h"
class PrefRegistrySimple;
namespace ash {
class ASH_EXPORT ScopedLedFallbackForTesting {
public:
explicit ScopedLedFallbackForTesting(bool value);
ScopedLedFallbackForTesting(const ScopedLedFallbackForTesting&) = delete;
ScopedLedFallbackForTesting& operator=(const ScopedLedFallbackForTesting&) =
delete;
~ScopedLedFallbackForTesting();
const bool value;
};
class ASH_EXPORT PrivacyHubController {
public:
explicit PrivacyHubController(base::PassKey<PrivacyHubController>);
PrivacyHubController(const PrivacyHubController&) = delete;
PrivacyHubController& operator=(const PrivacyHubController&) = delete;
~PrivacyHubController();
static std::unique_ptr<PrivacyHubController> CreatePrivacyHubController();
static PrivacyHubController* Get();
CameraPrivacySwitchController* camera_controller();
MicrophonePrivacySwitchController* microphone_controller();
SpeakOnMuteDetectionPrivacySwitchController* speak_on_mute_controller();
GeolocationPrivacySwitchController* geolocation_controller();
CameraPrivacySwitchController* CameraSynchronizerForTest();
static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
void SetFrontend(PrivacyHubDelegate* ptr);
PrivacyHubDelegate* frontend() { return frontend_; }
bool UsingCameraLEDFallback();
static bool CheckCameraLEDFallbackDirectly();
static bool CrosToArcGeolocationPermissionMapping(
GeolocationAccessLevel access_level);
private:
void InitUsingCameraLEDFallback();
std::unique_ptr<CameraPrivacySwitchController> camera_controller_;
std::unique_ptr<MicrophonePrivacySwitchController> microphone_controller_;
std::unique_ptr<SpeakOnMuteDetectionPrivacySwitchController>
speak_on_mute_controller_;
std::unique_ptr<GeolocationPrivacySwitchController>
geolocation_switch_controller_;
raw_ptr<PrivacyHubDelegate> frontend_ = nullptr;
bool using_camera_led_fallback_ = true;
};
}
#endif