Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/content_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 return; 1302 return;
1303 } 1303 }
1304 1304
1305 ContentSetting default_setting = ContentSettingFromString(setting); 1305 ContentSetting default_setting = ContentSettingFromString(setting);
1306 ContentSettingsType content_type = ContentSettingsTypeFromGroupName(group); 1306 ContentSettingsType content_type = ContentSettingsTypeFromGroupName(group);
1307 Profile* profile = Profile::FromWebUI(web_ui()); 1307 Profile* profile = Profile::FromWebUI(web_ui());
1308 1308
1309 #if defined(OS_CHROMEOS) 1309 #if defined(OS_CHROMEOS)
1310 // ChromeOS special case : in Guest mode settings are opened in Incognito 1310 // ChromeOS special case : in Guest mode settings are opened in Incognito
1311 // mode, so we need original profile to actually modify settings. 1311 // mode, so we need original profile to actually modify settings.
1312 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) 1312 if (chromeos::GetUserManager()->IsLoggedInAsGuest())
1313 profile = profile->GetOriginalProfile(); 1313 profile = profile->GetOriginalProfile();
1314 #endif 1314 #endif
1315 1315
1316 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) { 1316 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
1317 DesktopNotificationServiceFactory::GetForProfile(profile)-> 1317 DesktopNotificationServiceFactory::GetForProfile(profile)->
1318 SetDefaultContentSetting(default_setting); 1318 SetDefaultContentSetting(default_setting);
1319 } else { 1319 } else {
1320 HostContentSettingsMap* map = profile->GetHostContentSettingsMap(); 1320 HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
1321 ApplyWhitelist(content_type, default_setting); 1321 ApplyWhitelist(content_type, default_setting);
1322 map->SetDefaultContentSetting(content_type, default_setting); 1322 map->SetDefaultContentSetting(content_type, default_setting);
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { 1566 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() {
1567 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); 1567 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
1568 // Exceptions apply only when the feature is enabled. 1568 // Exceptions apply only when the feature is enabled.
1569 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); 1569 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
1570 web_ui()->CallJavascriptFunction( 1570 web_ui()->CallJavascriptFunction(
1571 "ContentSettings.enableProtectedContentExceptions", 1571 "ContentSettings.enableProtectedContentExceptions",
1572 base::FundamentalValue(enable_exceptions)); 1572 base::FundamentalValue(enable_exceptions));
1573 } 1573 }
1574 1574
1575 } // namespace options 1575 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/user_image_source.cc ('k') | chrome/browser/ui/webui/policy_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698