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

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: 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 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);
}
« 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