Index: chrome/browser/ui/webui/options2/content_settings_handler2.cc |
diff --git a/chrome/browser/ui/webui/options2/content_settings_handler2.cc b/chrome/browser/ui/webui/options2/content_settings_handler2.cc |
index 41832e595526204e9848257580892a50edb804c2..86b3dc89d5f7180c441af89def1b337e4cf0e83e 100644 |
--- a/chrome/browser/ui/webui/options2/content_settings_handler2.cc |
+++ b/chrome/browser/ui/webui/options2/content_settings_handler2.cc |
@@ -40,6 +40,10 @@ |
#include "grit/locale_settings.h" |
#include "ui/base/l10n/l10n_util.h" |
+#if defined(OS_CHROMEOS) |
+#include "chrome/browser/chromeos/login/user_manager.h" |
+#endif |
+ |
using content::UserMetricsAction; |
namespace { |
@@ -708,11 +712,20 @@ void ContentSettingsHandler::SetContentFilter(const ListValue* args) { |
ContentSetting default_setting = ContentSettingFromString(setting); |
ContentSettingsType content_type = ContentSettingsTypeFromGroupName(group); |
Profile* profile = Profile::FromWebUI(web_ui()); |
+ |
+#if defined(OS_CHROMEOS) |
+ // ChromeOS special case : in Guest mode settings are opened in Incognito |
+ // mode, so we need original profile to actually modify settings. |
+ if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) { |
James Hawkins
2012/02/29 15:15:09
Optional nit: no braces for single-line blocks.
Denis Kuznetsov (DE-MUC)
2012/02/29 15:55:43
Done.
|
+ profile = profile->GetOriginalProfile(); |
+ } |
+#endif |
+ |
if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) { |
DesktopNotificationServiceFactory::GetForProfile(profile)-> |
SetDefaultContentSetting(default_setting); |
} else { |
- HostContentSettingsMap* map = GetContentSettingsMap(); |
+ HostContentSettingsMap* map = profile->GetHostContentSettingsMap(); |
map->SetDefaultContentSetting(content_type, default_setting); |
ApplyWhitelist(content_type, default_setting); |
} |