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/profile_keyed_service_factory.h" | 5 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "chrome/browser/profiles/profile.h" | |
12 #include "chrome/browser/profiles/profile_dependency_manager.h" | 11 #include "chrome/browser/profiles/profile_dependency_manager.h" |
13 #include "chrome/browser/profiles/profile_keyed_service.h" | 12 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 13 #include "content/public/browser/browser_context.h" |
14 | 14 |
15 void ProfileKeyedServiceFactory::SetTestingFactory( | 15 void ProfileKeyedServiceFactory::SetTestingFactory( |
16 content::BrowserContext* profile, FactoryFunction factory) { | 16 content::BrowserContext* profile, FactoryFunction factory) { |
17 // Destroying the profile may cause us to lose data about whether |profile| | 17 // Destroying the profile may cause us to lose data about whether |profile| |
18 // has our preferences registered on it (since the profile object itself | 18 // has our preferences registered on it (since the profile object itself |
19 // isn't dead). See if we need to readd it once we've gone through normal | 19 // isn't dead). See if we need to readd it once we've gone through normal |
20 // destruction. | 20 // destruction. |
21 bool add_profile = ArePreferencesSetOn(profile); | 21 bool add_profile = ArePreferencesSetOn(profile); |
22 | 22 |
23 // We have to go through the shutdown and destroy mechanisms because there | 23 // We have to go through the shutdown and destroy mechanisms because there |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 void ProfileKeyedServiceFactory::SetEmptyTestingFactory( | 118 void ProfileKeyedServiceFactory::SetEmptyTestingFactory( |
119 content::BrowserContext* profile) { | 119 content::BrowserContext* profile) { |
120 SetTestingFactory(profile, NULL); | 120 SetTestingFactory(profile, NULL); |
121 } | 121 } |
122 | 122 |
123 void ProfileKeyedServiceFactory::CreateServiceNow( | 123 void ProfileKeyedServiceFactory::CreateServiceNow( |
124 content::BrowserContext* profile) { | 124 content::BrowserContext* profile) { |
125 GetServiceForProfile(profile, true); | 125 GetServiceForProfile(profile, true); |
126 } | 126 } |
OLD | NEW |