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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/settings/site_settings_handler.h" 5 #include "chrome/browser/ui/webui/settings/site_settings_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 433
434 HostContentSettingsMap* map = 434 HostContentSettingsMap* map =
435 HostContentSettingsMapFactory::GetForProfile(profile_); 435 HostContentSettingsMapFactory::GetForProfile(profile_);
436 const auto* extension_registry = extensions::ExtensionRegistry::Get(profile_); 436 const auto* extension_registry = extensions::ExtensionRegistry::Get(profile_);
437 AddExceptionsGrantedByHostedApps(profile_, APIPermissionFromGroupName(type), 437 AddExceptionsGrantedByHostedApps(profile_, APIPermissionFromGroupName(type),
438 exceptions.get()); 438 exceptions.get());
439 site_settings::GetExceptionsFromHostContentSettingsMap( 439 site_settings::GetExceptionsFromHostContentSettingsMap(
440 map, content_type, extension_registry, web_ui(), /*incognito=*/false, 440 map, content_type, extension_registry, web_ui(), /*incognito=*/false,
441 /*filter=*/nullptr, exceptions.get()); 441 /*filter=*/nullptr, exceptions.get());
442 442
443 if (profile_->HasOffTheRecordProfile()) { 443 Profile* incognito = profile_->HasOffTheRecordProfile()
444 Profile* incognito = profile_->GetOffTheRecordProfile(); 444 ? profile_->GetOffTheRecordProfile()
445 : nullptr;
446 // On Chrome OS in Guest mode the incognito profile is the primary profile,
447 // so do not fetch an extra copy of the same exceptions.
448 if (incognito && incognito != profile_) {
445 map = HostContentSettingsMapFactory::GetForProfile(incognito); 449 map = HostContentSettingsMapFactory::GetForProfile(incognito);
446 extension_registry = extensions::ExtensionRegistry::Get(incognito); 450 extension_registry = extensions::ExtensionRegistry::Get(incognito);
447 site_settings::GetExceptionsFromHostContentSettingsMap( 451 site_settings::GetExceptionsFromHostContentSettingsMap(
448 map, content_type, extension_registry, web_ui(), /*incognito=*/true, 452 map, content_type, extension_registry, web_ui(), /*incognito=*/true,
449 /*filter=*/nullptr, exceptions.get()); 453 /*filter=*/nullptr, exceptions.get());
450 } 454 }
451 455
452 ResolveJavascriptCallback(*callback_id, *exceptions.get()); 456 ResolveJavascriptCallback(*callback_id, *exceptions.get());
453 } 457 }
454 458
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 origin = content::kUnreachableWebDataURL; 749 origin = content::kUnreachableWebDataURL;
746 } 750 }
747 751
748 content::HostZoomMap* host_zoom_map; 752 content::HostZoomMap* host_zoom_map;
749 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_); 753 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_);
750 double default_level = host_zoom_map->GetDefaultZoomLevel(); 754 double default_level = host_zoom_map->GetDefaultZoomLevel();
751 host_zoom_map->SetZoomLevelForHost(origin, default_level); 755 host_zoom_map->SetZoomLevelForHost(origin, default_level);
752 } 756 }
753 757
754 } // namespace settings 758 } // namespace settings
OLDNEW
« 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