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

Unified Diff: chrome/browser/profile_impl.cc

Issue 3210007: Add support for a "split" incognito behavior for extensions. (Closed)
Patch Set: latest Created 10 years, 4 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/profile.cc ('k') | chrome/browser/resources/extensions_ui.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile_impl.cc
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index e81cef4990e337f378da55dd2ec0bca6e053e300..6a7cb51ed73bd11d27abfe187b8049e5537007fc 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -172,6 +172,7 @@ void PostExtensionLoadedToContextGetter(ChromeURLRequestContextGetter* getter,
extension->name(),
extension->path(),
extension->default_locale(),
+ extension->incognito_split_mode(),
extension->web_extent(),
extension->GetEffectiveHostPermissions(),
extension->api_permissions())));
@@ -369,7 +370,7 @@ void ProfileImpl::InitExtensions() {
extension_devtools_manager_ = new ExtensionDevToolsManager(this);
}
- extension_process_manager_.reset(new ExtensionProcessManager(this));
+ extension_process_manager_.reset(ExtensionProcessManager::Create(this));
extension_message_service_ = new ExtensionMessageService(this);
ExtensionErrorReporter::Init(true); // allow noisy errors.
@@ -737,6 +738,9 @@ URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() {
return extensions_request_context_;
}
+// TODO(mpcomplete): This is lame. 5+ copies of the extension data on the IO
+// thread. We should have 1 shared data object that all the contexts get access
+// to. Fix by M8.
void ProfileImpl::RegisterExtensionWithRequestContexts(
Extension* extension) {
// Notify the default, extension and media contexts on the IO thread.
@@ -751,6 +755,19 @@ void ProfileImpl::RegisterExtensionWithRequestContexts(
static_cast<ChromeURLRequestContextGetter*>(
GetRequestContextForMedia()),
extension);
+
+ // Ditto for OTR if it's active, except for the media context which is the
+ // same as the regular context.
+ if (off_the_record_profile_.get()) {
+ PostExtensionLoadedToContextGetter(
+ static_cast<ChromeURLRequestContextGetter*>(
+ off_the_record_profile_->GetRequestContext()),
+ extension);
+ PostExtensionLoadedToContextGetter(
+ static_cast<ChromeURLRequestContextGetter*>(
+ off_the_record_profile_->GetRequestContextForExtensions()),
+ extension);
+ }
}
void ProfileImpl::UnregisterExtensionWithRequestContexts(
@@ -767,6 +784,19 @@ void ProfileImpl::UnregisterExtensionWithRequestContexts(
static_cast<ChromeURLRequestContextGetter*>(
GetRequestContextForMedia()),
extension);
+
+ // Ditto for OTR if it's active, except for the media context which is the
+ // same as the regular context.
+ if (off_the_record_profile_.get()) {
+ PostExtensionUnloadedToContextGetter(
+ static_cast<ChromeURLRequestContextGetter*>(
+ off_the_record_profile_->GetRequestContext()),
+ extension);
+ PostExtensionUnloadedToContextGetter(
+ static_cast<ChromeURLRequestContextGetter*>(
+ off_the_record_profile_->GetRequestContextForExtensions()),
+ extension);
+ }
}
net::SSLConfigService* ProfileImpl::GetSSLConfigService() {
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/browser/resources/extensions_ui.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698