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

Unified Diff: chrome/browser/ui/webui/settings/site_settings_handler.cc

Issue 2933343003: Settings: Cookies: Avoid duplicate 'incognito' exceptions in CrOS Guest mode (Closed)
Patch Set: Created 3 years, 6 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 | « chrome/browser/resources/settings/site_settings/add_site_dialog.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 59a527eb8b23667fa662efe49ab04a54fdd9f66e..8d1981cadf58bb580a5d833209a5a17ab03542a8 100644
--- a/chrome/browser/ui/webui/settings/site_settings_handler.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -440,8 +440,12 @@ void SiteSettingsHandler::HandleGetExceptionList(const base::ListValue* args) {
map, content_type, extension_registry, web_ui(), /*incognito=*/false,
/*filter=*/nullptr, exceptions.get());
- if (profile_->HasOffTheRecordProfile()) {
- Profile* incognito = profile_->GetOffTheRecordProfile();
+ Profile* incognito = profile_->HasOffTheRecordProfile()
+ ? profile_->GetOffTheRecordProfile()
+ : nullptr;
+ // On Chrome OS in Guest mode the incognito profile is the primary profile,
+ // so do not fetch an extra copy of the same exceptions.
+ if (incognito && incognito != profile_) {
map = HostContentSettingsMapFactory::GetForProfile(incognito);
extension_registry = extensions::ExtensionRegistry::Get(incognito);
site_settings::GetExceptionsFromHostContentSettingsMap(
« no previous file with comments | « chrome/browser/resources/settings/site_settings/add_site_dialog.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698