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

Unified Diff: chrome/browser/ui/webui/options2/content_settings_handler2.cc

Issue 9522016: Settings->Advanced->Content settings are now applied correctly in Guest Mode (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Try upload again Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 013cb6b5826738ce975c77df6fc6a444ea6cd7ca..c5b771b5a51bd0fed1aa60343a963dcfc6331e35 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 {
@@ -711,11 +715,19 @@ 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())
+ 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();
ApplyWhitelist(content_type, default_setting);
map->SetDefaultContentSetting(content_type, default_setting);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698