OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_KEYED_SERVICE_IOS_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ | 5 #ifndef COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ |
6 #define COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ | 6 #define COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "components/keyed_service/core/keyed_service_export.h" | 10 #include "components/keyed_service/core/keyed_service_export.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // services that it may be holding. | 101 // services that it may be holding. |
102 // | 102 // |
103 // Secondly, BrowserStateDestroyed() is called on every ServiceFactory | 103 // Secondly, BrowserStateDestroyed() is called on every ServiceFactory |
104 // and the default implementation removes it from |mapping_| and deletes | 104 // and the default implementation removes it from |mapping_| and deletes |
105 // the pointer. | 105 // the pointer. |
106 virtual void BrowserStateShutdown(web::BrowserState* context); | 106 virtual void BrowserStateShutdown(web::BrowserState* context); |
107 virtual void BrowserStateDestroyed(web::BrowserState* context); | 107 virtual void BrowserStateDestroyed(web::BrowserState* context); |
108 | 108 |
109 private: | 109 private: |
110 // Registers any user preferences on this service. This is called by | 110 // Registers any user preferences on this service. This is called by |
111 // RegisterProfilePrefsIfNecessary() and should be overriden by any service | 111 // RegisterPrefsIfNecessaryForContext() and should be overriden by any service |
112 // that wants to register profile-specific preferences. | 112 // that wants to register profile-specific preferences. |
113 virtual void RegisterProfilePrefs( | 113 virtual void RegisterBrowserStatePrefs( |
114 user_prefs::PrefRegistrySyncable* registry) {} | 114 user_prefs::PrefRegistrySyncable* registry) {} |
115 | 115 |
116 // KeyedServiceFactory: | 116 // KeyedServiceFactory: |
117 KeyedService* BuildServiceInstanceFor( | 117 KeyedService* BuildServiceInstanceFor( |
118 base::SupportsUserData* context) const final; | 118 base::SupportsUserData* context) const final; |
119 bool IsOffTheRecord(base::SupportsUserData* context) const final; | 119 bool IsOffTheRecord(base::SupportsUserData* context) const final; |
120 | 120 |
121 // KeyedServiceBaseFactory: | 121 // KeyedServiceBaseFactory: |
122 user_prefs::PrefRegistrySyncable* GetAssociatedPrefRegistry( | 122 #if defined(OS_IOS) |
123 base::SupportsUserData* context) const final; | 123 base::SupportsUserData* GetTypedContext( |
| 124 base::SupportsUserData* context) const override; |
| 125 base::SupportsUserData* GetContextForDependencyManager( |
| 126 base::SupportsUserData* context) const override; |
| 127 #endif // defined(OS_IOS) |
124 base::SupportsUserData* GetContextToUse( | 128 base::SupportsUserData* GetContextToUse( |
125 base::SupportsUserData* context) const final; | 129 base::SupportsUserData* context) const final; |
126 bool ServiceIsCreatedWithContext() const final; | 130 bool ServiceIsCreatedWithContext() const final; |
127 void ContextShutdown(base::SupportsUserData* context) final; | 131 void ContextShutdown(base::SupportsUserData* context) final; |
128 void ContextDestroyed(base::SupportsUserData* context) final; | 132 void ContextDestroyed(base::SupportsUserData* context) final; |
129 void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) final; | 133 void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) final; |
130 | 134 |
131 DISALLOW_COPY_AND_ASSIGN(BrowserStateKeyedServiceFactory); | 135 DISALLOW_COPY_AND_ASSIGN(BrowserStateKeyedServiceFactory); |
132 }; | 136 }; |
133 | 137 |
134 #endif // COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ | 138 #endif // COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ |
OLD | NEW |