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/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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 base::Bind(&TestingProfile::FinishInit, | 191 base::Bind(&TestingProfile::FinishInit, |
192 base::Unretained(this))); | 192 base::Unretained(this))); |
193 } else { | 193 } else { |
194 FinishInit(); | 194 FinishInit(); |
195 } | 195 } |
196 } | 196 } |
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 #if defined(ENABLE_NOTIFICATIONS) |
201 // Install profile keyed service factory hooks for dummy/test services | 202 // Install profile keyed service factory hooks for dummy/test services |
202 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( | 203 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( |
203 this, CreateTestDesktopNotificationService); | 204 this, CreateTestDesktopNotificationService); |
| 205 #endif |
204 } | 206 } |
205 | 207 |
206 void TestingProfile::FinishInit() { | 208 void TestingProfile::FinishInit() { |
207 DCHECK(content::NotificationService::current()); | 209 DCHECK(content::NotificationService::current()); |
208 content::NotificationService::current()->Notify( | 210 content::NotificationService::current()->Notify( |
209 chrome::NOTIFICATION_PROFILE_CREATED, | 211 chrome::NOTIFICATION_PROFILE_CREATED, |
210 content::Source<Profile>(static_cast<Profile*>(this)), | 212 content::Source<Profile>(static_cast<Profile*>(this)), |
211 content::NotificationService::NoDetails()); | 213 content::NotificationService::NoDetails()); |
212 | 214 |
213 if (delegate_) | 215 if (delegate_) |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 759 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
758 return GetExtensionSpecialStoragePolicy(); | 760 return GetExtensionSpecialStoragePolicy(); |
759 } | 761 } |
760 | 762 |
761 void TestingProfile::DestroyWebDataService() { | 763 void TestingProfile::DestroyWebDataService() { |
762 if (!web_data_service_.get()) | 764 if (!web_data_service_.get()) |
763 return; | 765 return; |
764 | 766 |
765 web_data_service_->Shutdown(); | 767 web_data_service_->Shutdown(); |
766 } | 768 } |
OLD | NEW |