diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 18:40:32 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 18:40:32 +0000 |
commit | bc535ee5bb4eece29f5d88bcc688613b3b208b27 (patch) | |
tree | 37b90c6bbbe98732c81515b35f02f8b835ac5df7 /chrome/browser/profile_impl.cc | |
parent | 7566dbf757617f9e77f4a7f9f031402eb7818b04 (diff) | |
download | chromium_src-bc535ee5bb4eece29f5d88bcc688613b3b208b27.zip chromium_src-bc535ee5bb4eece29f5d88bcc688613b3b208b27.tar.gz chromium_src-bc535ee5bb4eece29f5d88bcc688613b3b208b27.tar.bz2 |
Add support for a "split" incognito behavior for extensions.
- On by default for apps, off by default for extensions.
- Split mode means "run incognito extensions in a separate process if the user
says OK, and the two processes can only see their own profile."
- Spanning mode is what we have now, and means "run a single extension process,
but allow it to access both profiles if the user says OK."
BUG=49232
BUG=49114
TEST=extensions still work in incognito when you check "Allow in Incognito".
Review URL: http://codereview.chromium.org/3210007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile_impl.cc')
-rw-r--r-- | chrome/browser/profile_impl.cc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc index e81cef4..6a7cb51 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() { |