Commit 12750731 authored by Tim Song's avatar Tim Song Committed by Commit Bot

Ash Display: Prevent toggling privacy screen setting if it is policy managed.

BUG=1040648

Change-Id: I897158eb5098bd08d36b2a37b0a1731909ae51e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095669Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarGil Dekel <gildekel@chromium.org>
Commit-Queue: Tim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748431}
parent 9213a1fe
...@@ -53,6 +53,14 @@ void PrivacyScreenController::SetEnabled(bool enabled) { ...@@ -53,6 +53,14 @@ void PrivacyScreenController::SetEnabled(bool enabled) {
return; return;
} }
// Do not set the policy if it is managed by policy. However, we still want to
// notify observers that a change was attempted in order to show a toast.
if (IsManaged()) {
for (Observer& observer : observers_)
observer.OnPrivacyScreenSettingChanged(GetEnabled());
return;
}
if (active_user_pref_service_) { if (active_user_pref_service_) {
active_user_pref_service_->SetBoolean(prefs::kDisplayPrivacyScreenEnabled, active_user_pref_service_->SetBoolean(prefs::kDisplayPrivacyScreenEnabled,
enabled); enabled);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment