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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 2866613003: Solve ProfileIOData, Extension, HostContentSettingsMap ordering issue. (Closed)
Patch Set: Uninteresting merge, add TODO Created 3 years, 7 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/extensions/extension_service.h ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 196834e0036cf509a01a950d9200c00e05d46340..8156b79538ea25d3d2f35e075d54056b156be816 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -2046,21 +2046,27 @@ const Extension* ExtensionService::GetPendingExtensionUpdate(
}
void ExtensionService::RegisterContentSettings(
- HostContentSettingsMap* host_content_settings_map) {
+ HostContentSettingsMap* host_content_settings_map,
+ Profile* profile) {
+ // Most extension services key off of the original profile.
+ Profile* original_profile = profile->GetOriginalProfile();
+
TRACE_EVENT0("browser,startup", "ExtensionService::RegisterContentSettings");
DCHECK_CURRENTLY_ON(BrowserThread::UI);
host_content_settings_map->RegisterProvider(
HostContentSettingsMap::INTERNAL_EXTENSION_PROVIDER,
std::unique_ptr<content_settings::ObservableProvider>(
- new content_settings::InternalExtensionProvider(profile_)));
+ new content_settings::InternalExtensionProvider(original_profile)));
host_content_settings_map->RegisterProvider(
HostContentSettingsMap::CUSTOM_EXTENSION_PROVIDER,
std::unique_ptr<content_settings::ObservableProvider>(
new content_settings::CustomExtensionProvider(
- extensions::ContentSettingsService::Get(profile_)
+ extensions::ContentSettingsService::Get(original_profile)
->content_settings_store(),
- profile_->GetOriginalProfile() != profile_)));
+ // TODO(mmenke): CustomExtensionProvider expects this to be true
+ // for incognito profiles.
+ false)));
}
void ExtensionService::TrackTerminatedExtension(
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698