Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 | 118 |
| 119 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 119 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
| 120 PluginPrefs::GetForProfile(this), io_data_.GetResourceContextNoInit()); | 120 PluginPrefs::GetForProfile(this), io_data_.GetResourceContextNoInit()); |
| 121 | 121 |
| 122 BrowserThread::PostTask( | 122 BrowserThread::PostTask( |
| 123 BrowserThread::IO, FROM_HERE, | 123 BrowserThread::IO, FROM_HERE, |
| 124 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); | 124 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { | 127 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { |
| 128 MaybeSendDestroyedNotification(); | 128 MaybeSendDestroyedNotification(); |
|
sail
2012/10/25 19:22:00
Hm.. do you really need to change profiles code to
Joe Thomas
2012/10/25 19:49:42
MenuManager for Extensions is owned by the Extensi
sail
2012/10/25 19:56:14
This isn't idea. Simply adding every feature into
Joe Thomas
2012/10/26 03:49:54
I moved this code out of chrome/browser/profile* t
sail
2012/10/26 04:36:30
Thanks.
| |
| 129 | 129 |
| 130 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 130 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
| 131 io_data_.GetResourceContextNoInit()); | 131 io_data_.GetResourceContextNoInit()); |
| 132 | 132 |
| 133 ExtensionService* extension_service = | 133 ExtensionService* extension_service = |
| 134 extensions::ExtensionSystem::Get(this)->extension_service(); | 134 extensions::ExtensionSystem::Get(this)->extension_service(); |
| 135 if (extension_service && extension_service->extensions_enabled()) { | 135 if (extension_service && extension_service->extensions_enabled()) { |
| 136 extension_service->extension_prefs()-> | 136 extension_service->extension_prefs()-> |
| 137 ClearIncognitoSessionOnlyContentSettings(); | 137 ClearIncognitoSessionOnlyContentSettings(); |
| 138 extension_service->menu_manager()->RemoveAllIncognitoContextItems(); | |
|
sail
2012/10/25 19:22:00
This needs a test (something that doesn't pass wit
Joe Thomas
2012/10/25 19:49:42
I already added a unit test for the new function t
sail
2012/10/25 19:56:14
Take a look at profile_browsertest.cc and profile_
| |
| 138 } | 139 } |
| 139 | 140 |
| 140 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 141 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
| 141 | 142 |
| 142 BrowserThread::PostTask( | 143 BrowserThread::PostTask( |
| 143 BrowserThread::IO, FROM_HERE, | 144 BrowserThread::IO, FROM_HERE, |
| 144 base::Bind(&NotifyOTRProfileDestroyedOnIOThread, profile_, this)); | 145 base::Bind(&NotifyOTRProfileDestroyedOnIOThread, profile_, this)); |
| 145 | 146 |
| 146 if (host_content_settings_map_) | 147 if (host_content_settings_map_) |
| 147 host_content_settings_map_->ShutdownOnUIThread(); | 148 host_content_settings_map_->ShutdownOnUIThread(); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 if (!profile) | 502 if (!profile) |
| 502 profile = new OffTheRecordProfileImpl(this); | 503 profile = new OffTheRecordProfileImpl(this); |
| 503 profile->Init(); | 504 profile->Init(); |
| 504 return profile; | 505 return profile; |
| 505 } | 506 } |
| 506 | 507 |
| 507 base::Callback<ChromeURLDataManagerBackend*(void)> | 508 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 508 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 509 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
| 509 return io_data_.GetChromeURLDataManagerBackendGetter(); | 510 return io_data_.GetChromeURLDataManagerBackendGetter(); |
| 510 } | 511 } |
| OLD | NEW |