From e83e359eb0ae40d1d479eb0f281f0b21d713919b Mon Sep 17 00:00:00 2001 From: michaelpg Date: Wed, 24 Sep 2014 14:48:12 -0700 Subject: [PATCH] Disable protected content button in Guest mode settings UIAccountTweaks disables the "manage protected content exceptions" button in guest mode, but the ContentSettingsHandler re-enables it. BUG=417103 R=stevenjb@chromium.org Review URL: https://codereview.chromium.org/601633002 Cr-Commit-Position: refs/heads/master@{#296531} --- chrome/browser/ui/webui/options/content_settings_handler.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 48865b87f763..7a4babbba338 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -1495,8 +1495,14 @@ void ContentSettingsHandler::UpdateFlashMediaLinksVisibility() { } void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { - PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); +#if defined(OS_CHROMEOS) + // Guests cannot modify exceptions. UIAccountTweaks will disabled the button. + if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) + return; +#endif + // Exceptions apply only when the feature is enabled. + PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); web_ui()->CallJavascriptFunction( "ContentSettings.enableProtectedContentExceptions", -- 2.11.4.GIT