| 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/testing_profile.h" | 5 #include "chrome/test/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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Install profile keyed service factory hooks for dummy/test services | 160 // Install profile keyed service factory hooks for dummy/test services |
| 161 BackgroundContentsServiceFactory::GetInstance()->SetTestingFactory( | 161 BackgroundContentsServiceFactory::GetInstance()->SetTestingFactory( |
| 162 this, NULL); | 162 this, NULL); |
| 163 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( | 163 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( |
| 164 this, CreateTestDesktopNotificationService); | 164 this, CreateTestDesktopNotificationService); |
| 165 SessionServiceFactory::GetInstance()->SetTestingFactory(this, NULL); | 165 SessionServiceFactory::GetInstance()->SetTestingFactory(this, NULL); |
| 166 TabRestoreServiceFactory::GetInstance()->SetTestingFactory(this, NULL); | 166 TabRestoreServiceFactory::GetInstance()->SetTestingFactory(this, NULL); |
| 167 TemplateURLServiceFactory::GetInstance()->SetTestingFactory(this, NULL); | 167 TemplateURLServiceFactory::GetInstance()->SetTestingFactory(this, NULL); |
| 168 |
| 169 NotificationService::current()->Notify( |
| 170 chrome::NOTIFICATION_PROFILE_CREATED, |
| 171 Source<Profile>(static_cast<Profile*>(this)), |
| 172 NotificationService::NoDetails()); |
| 168 } | 173 } |
| 169 | 174 |
| 170 TestingProfile::~TestingProfile() { | 175 TestingProfile::~TestingProfile() { |
| 171 NotificationService::current()->Notify( | 176 NotificationService::current()->Notify( |
| 172 chrome::NOTIFICATION_PROFILE_DESTROYED, | 177 chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 173 Source<Profile>(static_cast<Profile*>(this)), | 178 Source<Profile>(static_cast<Profile*>(this)), |
| 174 NotificationService::NoDetails()); | 179 NotificationService::NoDetails()); |
| 175 | 180 |
| 176 profile_dependency_manager_->DestroyProfileServices(this); | 181 profile_dependency_manager_->DestroyProfileServices(this); |
| 177 | 182 |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 793 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
| 789 return GetExtensionSpecialStoragePolicy(); | 794 return GetExtensionSpecialStoragePolicy(); |
| 790 } | 795 } |
| 791 | 796 |
| 792 void TestingProfile::DestroyWebDataService() { | 797 void TestingProfile::DestroyWebDataService() { |
| 793 if (!web_data_service_.get()) | 798 if (!web_data_service_.get()) |
| 794 return; | 799 return; |
| 795 | 800 |
| 796 web_data_service_->Shutdown(); | 801 web_data_service_->Shutdown(); |
| 797 } | 802 } |
| OLD | NEW |