OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 void TestingProfile::Init() { | 198 void TestingProfile::Init() { |
199 profile_dependency_manager_->CreateProfileServices(this, true); | 199 profile_dependency_manager_->CreateProfileServices(this, true); |
200 | 200 |
201 // Install profile keyed service factory hooks for dummy/test services | 201 // Install profile keyed service factory hooks for dummy/test services |
202 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( | 202 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( |
203 this, CreateTestDesktopNotificationService); | 203 this, CreateTestDesktopNotificationService); |
204 } | 204 } |
205 | 205 |
206 void TestingProfile::FinishInit() { | 206 void TestingProfile::FinishInit() { |
| 207 DCHECK(content::NotificationService::current()); |
207 content::NotificationService::current()->Notify( | 208 content::NotificationService::current()->Notify( |
208 chrome::NOTIFICATION_PROFILE_CREATED, | 209 chrome::NOTIFICATION_PROFILE_CREATED, |
209 content::Source<Profile>(static_cast<Profile*>(this)), | 210 content::Source<Profile>(static_cast<Profile*>(this)), |
210 content::NotificationService::NoDetails()); | 211 content::NotificationService::NoDetails()); |
211 | 212 |
212 if (delegate_) | 213 if (delegate_) |
213 delegate_->OnProfileCreated(this, true); | 214 delegate_->OnProfileCreated(this, true); |
214 } | 215 } |
215 | 216 |
216 TestingProfile::~TestingProfile() { | 217 TestingProfile::~TestingProfile() { |
| 218 DCHECK(content::NotificationService::current()); |
217 content::NotificationService::current()->Notify( | 219 content::NotificationService::current()->Notify( |
218 chrome::NOTIFICATION_PROFILE_DESTROYED, | 220 chrome::NOTIFICATION_PROFILE_DESTROYED, |
219 content::Source<Profile>(static_cast<Profile*>(this)), | 221 content::Source<Profile>(static_cast<Profile*>(this)), |
220 content::NotificationService::NoDetails()); | 222 content::NotificationService::NoDetails()); |
221 | 223 |
222 profile_dependency_manager_->DestroyProfileServices(this); | 224 profile_dependency_manager_->DestroyProfileServices(this); |
223 | 225 |
224 if (host_content_settings_map_) | 226 if (host_content_settings_map_) |
225 host_content_settings_map_->ShutdownOnUIThread(); | 227 host_content_settings_map_->ShutdownOnUIThread(); |
226 | 228 |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 856 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
855 return GetExtensionSpecialStoragePolicy(); | 857 return GetExtensionSpecialStoragePolicy(); |
856 } | 858 } |
857 | 859 |
858 void TestingProfile::DestroyWebDataService() { | 860 void TestingProfile::DestroyWebDataService() { |
859 if (!web_data_service_.get()) | 861 if (!web_data_service_.get()) |
860 return; | 862 return; |
861 | 863 |
862 web_data_service_->Shutdown(); | 864 web_data_service_->Shutdown(); |
863 } | 865 } |
OLD | NEW |