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 COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_FACT
ORY_H_ | 5 #ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_FACT
ORY_H_ |
6 #define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_FACT
ORY_H_ | 6 #define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_FACT
ORY_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" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Interface for people building a concrete FooServiceFactory: -------------- | 58 // Interface for people building a concrete FooServiceFactory: -------------- |
59 | 59 |
60 // Finds which browser context (if any) to use. | 60 // Finds which browser context (if any) to use. |
61 virtual content::BrowserContext* GetBrowserContextToUse( | 61 virtual content::BrowserContext* GetBrowserContextToUse( |
62 content::BrowserContext* context) const; | 62 content::BrowserContext* context) const; |
63 | 63 |
64 // Register any user preferences on this service. This is called during | 64 // Register any user preferences on this service. This is called during |
65 // CreateBrowserContextService() since preferences are registered on a per | 65 // CreateBrowserContextService() since preferences are registered on a per |
66 // BrowserContext basis. | 66 // BrowserContext basis. |
67 virtual void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) {} | 67 virtual void RegisterProfilePrefs( |
| 68 user_prefs::PrefRegistrySyncable* registry) {} |
68 | 69 |
69 // By default, we create instances of a service lazily and wait until | 70 // By default, we create instances of a service lazily and wait until |
70 // GetForBrowserContext() is called on our subclass. Some services need to be | 71 // GetForBrowserContext() is called on our subclass. Some services need to be |
71 // created as soon as the BrowserContext has been brought up. | 72 // created as soon as the BrowserContext has been brought up. |
72 virtual bool ServiceIsCreatedWithBrowserContext() const; | 73 virtual bool ServiceIsCreatedWithBrowserContext() const; |
73 | 74 |
74 // By default, TestingBrowserContexts will be treated like normal contexts. | 75 // By default, TestingBrowserContexts will be treated like normal contexts. |
75 // You can override this so that by default, the service associated with the | 76 // You can override this so that by default, the service associated with the |
76 // TestingBrowserContext is NULL. (This is just a shortcut around | 77 // TestingBrowserContext is NULL. (This is just a shortcut around |
77 // SetTestingFactory() to make sure our contexts don't directly refer to the | 78 // SetTestingFactory() to make sure our contexts don't directly refer to the |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 131 |
131 #if !defined(NDEBUG) | 132 #if !defined(NDEBUG) |
132 // A static string passed in to our constructor. Should be unique across all | 133 // A static string passed in to our constructor. Should be unique across all |
133 // services. This is used only for debugging in debug mode. (We can print | 134 // services. This is used only for debugging in debug mode. (We can print |
134 // pretty graphs with GraphViz with this information.) | 135 // pretty graphs with GraphViz with this information.) |
135 const char* service_name_; | 136 const char* service_name_; |
136 #endif | 137 #endif |
137 }; | 138 }; |
138 | 139 |
139 #endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_F
ACTORY_H_ | 140 #endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_F
ACTORY_H_ |
OLD | NEW |