Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/site_settings_handler.cc |
| diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chrome/browser/ui/webui/settings/site_settings_handler.cc |
| index 3a0954a4b0b48260a2d41653bdee78ef26c3100e..e83f19897b94bafe22a915ebd08f4c211c37c552 100644 |
| --- a/chrome/browser/ui/webui/settings/site_settings_handler.cc |
| +++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc |
| @@ -37,6 +37,10 @@ |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/text/bytes_formatting.h" |
| +#if defined(OS_CHROMEOS) |
| +#include "components/user_manager/user_manager.h" |
| +#endif |
| + |
| namespace settings { |
| namespace { |
| @@ -374,8 +378,15 @@ void SiteSettingsHandler::HandleSetDefaultValueForContentType( |
| ContentSetting default_setting; |
| CHECK(content_settings::ContentSettingFromString(setting, &default_setting)); |
| + Profile* profile = profile_; |
| +#if defined(OS_CHROMEOS) |
| + // ChromeOS special case : in Guest mode settings are opened in Incognito |
|
dschuyler
2017/02/06 20:19:19
nit: no space before colon here ("case:").
(Oh, an
stevenjb
2017/02/07 01:30:12
Done. (I copy/pasted this)
|
| + // mode, so we need original profile to actually modify settings. |
|
dschuyler
2017/02/06 20:19:19
? "need the original"
stevenjb
2017/02/07 01:30:12
Done.
|
| + if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
| + profile = profile->GetOriginalProfile(); |
| +#endif |
| HostContentSettingsMap* map = |
| - HostContentSettingsMapFactory::GetForProfile(profile_); |
| + HostContentSettingsMapFactory::GetForProfile(profile); |
| map->SetDefaultContentSetting( |
| static_cast<ContentSettingsType>(static_cast<int>( |
| site_settings::ContentSettingsTypeFromGroupName(content_type))), |