| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 #if defined(OS_CHROMEOS) | 109 #if defined(OS_CHROMEOS) |
| 110 GetRequestContext(); | 110 GetRequestContext(); |
| 111 #endif // defined(OS_CHROMEOS) | 111 #endif // defined(OS_CHROMEOS) |
| 112 | 112 |
| 113 InitHostZoomMap(); | 113 InitHostZoomMap(); |
| 114 | 114 |
| 115 // Make the chrome//extension-icon/ resource available. | 115 // Make the chrome//extension-icon/ resource available. |
| 116 ExtensionIconSource* icon_source = new ExtensionIconSource(profile_); | 116 ExtensionIconSource* icon_source = new ExtensionIconSource(profile_); |
| 117 ChromeURLDataManager::AddDataSource(this, icon_source); | 117 ChromeURLDataManager::AddDataSource(this, icon_source); |
| 118 | 118 |
| 119 #if defined(ENABLE_PLUGINS) |
| 119 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 120 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
| 120 PluginPrefs::GetForProfile(this), io_data_.GetResourceContextNoInit()); | 121 PluginPrefs::GetForProfile(this), io_data_.GetResourceContextNoInit()); |
| 122 #endif |
| 121 | 123 |
| 122 BrowserThread::PostTask( | 124 BrowserThread::PostTask( |
| 123 BrowserThread::IO, FROM_HERE, | 125 BrowserThread::IO, FROM_HERE, |
| 124 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); | 126 base::Bind(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); |
| 125 } | 127 } |
| 126 | 128 |
| 127 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { | 129 OffTheRecordProfileImpl::~OffTheRecordProfileImpl() { |
| 128 MaybeSendDestroyedNotification(); | 130 MaybeSendDestroyedNotification(); |
| 129 | 131 |
| 132 #if defined(ENABLE_PLUGINS) |
| 130 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 133 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
| 131 io_data_.GetResourceContextNoInit()); | 134 io_data_.GetResourceContextNoInit()); |
| 135 #endif |
| 132 | 136 |
| 133 ExtensionService* extension_service = | 137 ExtensionService* extension_service = |
| 134 extensions::ExtensionSystem::Get(this)->extension_service(); | 138 extensions::ExtensionSystem::Get(this)->extension_service(); |
| 135 if (extension_service && extension_service->extensions_enabled()) { | 139 if (extension_service && extension_service->extensions_enabled()) { |
| 136 extension_service->extension_prefs()-> | 140 extension_service->extension_prefs()-> |
| 137 ClearIncognitoSessionOnlyContentSettings(); | 141 ClearIncognitoSessionOnlyContentSettings(); |
| 138 } | 142 } |
| 139 | 143 |
| 140 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 144 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
| 141 | 145 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 if (!profile) | 482 if (!profile) |
| 479 profile = new OffTheRecordProfileImpl(this); | 483 profile = new OffTheRecordProfileImpl(this); |
| 480 profile->Init(); | 484 profile->Init(); |
| 481 return profile; | 485 return profile; |
| 482 } | 486 } |
| 483 | 487 |
| 484 base::Callback<ChromeURLDataManagerBackend*(void)> | 488 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 485 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 489 OffTheRecordProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
| 486 return io_data_.GetChromeURLDataManagerBackendGetter(); | 490 return io_data_.GetChromeURLDataManagerBackendGetter(); |
| 487 } | 491 } |
| OLD | NEW |