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 #ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
| 11 #include "chrome/browser/profiles/dependency_node.h" |
11 | 12 |
12 class PrefRegistrySyncable; | 13 class PrefRegistrySyncable; |
13 class PrefService; | 14 class PrefService; |
14 class Profile; | 15 class Profile; |
15 class ProfileDependencyManager; | 16 class ProfileDependencyManager; |
16 | 17 |
17 // Base class for Factories that take a Profile object and return some service. | 18 // Base class for Factories that take a Profile object and return some service. |
18 // | 19 // |
19 // Unless you're trying to make a new type of Factory, you probably don't want | 20 // Unless you're trying to make a new type of Factory, you probably don't want |
20 // this class, but its subclasses: ProfileKeyedServiceFactory and | 21 // this class, but its subclasses: ProfileKeyedServiceFactory and |
21 // RefcountedProfileKeyedServiceFactory. This object describes general | 22 // RefcountedProfileKeyedServiceFactory. This object describes general |
22 // dependency management between Factories; subclasses react to lifecycle | 23 // dependency management between Factories; subclasses react to lifecycle |
23 // events and implement memory management. | 24 // events and implement memory management. |
24 class ProfileKeyedBaseFactory : public base::NonThreadSafe { | 25 class ProfileKeyedBaseFactory : public base::NonThreadSafe, |
| 26 public DependencyNode { |
25 public: | 27 public: |
26 // Registers preferences used in this service on the pref service of | 28 // Registers preferences used in this service on the pref service of |
27 // |profile|. This is the public interface and is safe to be called multiple | 29 // |profile|. This is the public interface and is safe to be called multiple |
28 // times because testing code can have multiple services of the same type | 30 // times because testing code can have multiple services of the same type |
29 // attached to a single |profile|. | 31 // attached to a single |profile|. |
30 void RegisterUserPrefsOnProfile(Profile* profile); | 32 void RegisterUserPrefsOnProfile(Profile* profile); |
31 | 33 |
32 #ifndef NDEBUG | 34 #ifndef NDEBUG |
33 // Returns our name. We don't keep track of this in release mode. | 35 // Returns our name. We don't keep track of this in release mode. |
34 const char* name() const { return service_name_; } | 36 const char* name() const { return service_name_; } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 125 |
124 #if !defined(NDEBUG) | 126 #if !defined(NDEBUG) |
125 // A static string passed in to our constructor. Should be unique across all | 127 // A static string passed in to our constructor. Should be unique across all |
126 // services. This is used only for debugging in debug mode. (We can print | 128 // services. This is used only for debugging in debug mode. (We can print |
127 // pretty graphs with GraphViz with this information.) | 129 // pretty graphs with GraphViz with this information.) |
128 const char* service_name_; | 130 const char* service_name_; |
129 #endif | 131 #endif |
130 }; | 132 }; |
131 | 133 |
132 #endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ | 134 #endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ |
OLD | NEW |