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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 | 168 |
169 TestingProfile::~TestingProfile() { | 169 TestingProfile::~TestingProfile() { |
170 NotificationService::current()->Notify( | 170 NotificationService::current()->Notify( |
171 NotificationType::PROFILE_DESTROYED, | 171 NotificationType::PROFILE_DESTROYED, |
172 Source<Profile>(static_cast<Profile*>(this)), | 172 Source<Profile>(static_cast<Profile*>(this)), |
173 NotificationService::NoDetails()); | 173 NotificationService::NoDetails()); |
174 | 174 |
175 profile_dependency_manager_->DestroyProfileServices(this); | 175 profile_dependency_manager_->DestroyProfileServices(this); |
176 | 176 |
| 177 if (host_content_settings_map_) |
| 178 host_content_settings_map_->ShutdownOnUIThread(); |
| 179 |
177 DestroyTopSites(); | 180 DestroyTopSites(); |
178 DestroyHistoryService(); | 181 DestroyHistoryService(); |
179 // FaviconService depends on HistoryServce so destroying it later. | 182 // FaviconService depends on HistoryServce so destroying it later. |
180 DestroyFaviconService(); | 183 DestroyFaviconService(); |
181 DestroyWebDataService(); | 184 DestroyWebDataService(); |
182 if (extension_service_.get()) { | |
183 extension_service_.reset(); | |
184 } | |
185 | 185 |
186 if (pref_proxy_config_tracker_.get()) | 186 if (pref_proxy_config_tracker_.get()) |
187 pref_proxy_config_tracker_->DetachFromPrefService(); | 187 pref_proxy_config_tracker_->DetachFromPrefService(); |
188 } | 188 } |
189 | 189 |
190 void TestingProfile::CreateFaviconService() { | 190 void TestingProfile::CreateFaviconService() { |
191 favicon_service_ = NULL; | 191 favicon_service_ = NULL; |
192 favicon_service_ = new FaviconService(this); | 192 favicon_service_ = new FaviconService(this); |
193 } | 193 } |
194 | 194 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 return content::MockResourceContext::GetInstance(); | 603 return content::MockResourceContext::GetInstance(); |
604 } | 604 } |
605 | 605 |
606 FindBarState* TestingProfile::GetFindBarState() { | 606 FindBarState* TestingProfile::GetFindBarState() { |
607 if (!find_bar_state_.get()) | 607 if (!find_bar_state_.get()) |
608 find_bar_state_.reset(new FindBarState()); | 608 find_bar_state_.reset(new FindBarState()); |
609 return find_bar_state_.get(); | 609 return find_bar_state_.get(); |
610 } | 610 } |
611 | 611 |
612 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { | 612 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { |
613 if (!host_content_settings_map_.get()) | 613 if (!host_content_settings_map_.get()) { |
614 host_content_settings_map_ = new HostContentSettingsMap(this); | 614 host_content_settings_map_ = new HostContentSettingsMap( |
| 615 GetPrefs(), GetExtensionService(), false); |
| 616 } |
615 return host_content_settings_map_.get(); | 617 return host_content_settings_map_.get(); |
616 } | 618 } |
617 | 619 |
618 GeolocationContentSettingsMap* | 620 GeolocationContentSettingsMap* |
619 TestingProfile::GetGeolocationContentSettingsMap() { | 621 TestingProfile::GetGeolocationContentSettingsMap() { |
620 if (!geolocation_content_settings_map_.get()) { | 622 if (!geolocation_content_settings_map_.get()) { |
621 geolocation_content_settings_map_ = | 623 geolocation_content_settings_map_ = |
622 new GeolocationContentSettingsMap(this); | 624 new GeolocationContentSettingsMap(this); |
623 } | 625 } |
624 return geolocation_content_settings_map_.get(); | 626 return geolocation_content_settings_map_.get(); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 } | 788 } |
787 | 789 |
788 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 790 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) |
789 : original_profile_(profile) {} | 791 : original_profile_(profile) {} |
790 | 792 |
791 DerivedTestingProfile::~DerivedTestingProfile() {} | 793 DerivedTestingProfile::~DerivedTestingProfile() {} |
792 | 794 |
793 ProfileId DerivedTestingProfile::GetRuntimeId() { | 795 ProfileId DerivedTestingProfile::GetRuntimeId() { |
794 return original_profile_->GetRuntimeId(); | 796 return original_profile_->GetRuntimeId(); |
795 } | 797 } |
OLD | NEW |