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 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 5 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
9 #include "components/keyed_service/core/keyed_service.h" | 9 #include "components/keyed_service/core/keyed_service.h" |
10 #include "components/pref_registry/pref_registry_syncable.h" | 10 #include "components/pref_registry/pref_registry_syncable.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void BrowserContextKeyedServiceFactory::BrowserContextShutdown( | 78 void BrowserContextKeyedServiceFactory::BrowserContextShutdown( |
79 content::BrowserContext* context) { | 79 content::BrowserContext* context) { |
80 KeyedServiceFactory::ContextShutdown(context); | 80 KeyedServiceFactory::ContextShutdown(context); |
81 } | 81 } |
82 | 82 |
83 void BrowserContextKeyedServiceFactory::BrowserContextDestroyed( | 83 void BrowserContextKeyedServiceFactory::BrowserContextDestroyed( |
84 content::BrowserContext* context) { | 84 content::BrowserContext* context) { |
85 KeyedServiceFactory::ContextDestroyed(context); | 85 KeyedServiceFactory::ContextDestroyed(context); |
86 } | 86 } |
87 | 87 |
88 KeyedService* BrowserContextKeyedServiceFactory::BuildServiceInstanceFor( | 88 scoped_ptr<KeyedService> |
| 89 BrowserContextKeyedServiceFactory::BuildServiceInstanceFor( |
89 base::SupportsUserData* context) const { | 90 base::SupportsUserData* context) const { |
90 return BuildServiceInstanceFor( | 91 // TODO(isherman): The wrapped BuildServiceInstanceFor() should return a |
91 static_cast<content::BrowserContext*>(context)); | 92 // scoped_ptr as well. |
| 93 return make_scoped_ptr( |
| 94 BuildServiceInstanceFor(static_cast<content::BrowserContext*>(context))); |
92 } | 95 } |
93 | 96 |
94 bool BrowserContextKeyedServiceFactory::IsOffTheRecord( | 97 bool BrowserContextKeyedServiceFactory::IsOffTheRecord( |
95 base::SupportsUserData* context) const { | 98 base::SupportsUserData* context) const { |
96 return static_cast<content::BrowserContext*>(context)->IsOffTheRecord(); | 99 return static_cast<content::BrowserContext*>(context)->IsOffTheRecord(); |
97 } | 100 } |
98 | 101 |
99 base::SupportsUserData* BrowserContextKeyedServiceFactory::GetContextToUse( | 102 base::SupportsUserData* BrowserContextKeyedServiceFactory::GetContextToUse( |
100 base::SupportsUserData* context) const { | 103 base::SupportsUserData* context) const { |
101 return GetBrowserContextToUse(static_cast<content::BrowserContext*>(context)); | 104 return GetBrowserContextToUse(static_cast<content::BrowserContext*>(context)); |
(...skipping 10 matching lines...) Expand all Loading... |
112 | 115 |
113 void BrowserContextKeyedServiceFactory::ContextDestroyed( | 116 void BrowserContextKeyedServiceFactory::ContextDestroyed( |
114 base::SupportsUserData* context) { | 117 base::SupportsUserData* context) { |
115 BrowserContextDestroyed(static_cast<content::BrowserContext*>(context)); | 118 BrowserContextDestroyed(static_cast<content::BrowserContext*>(context)); |
116 } | 119 } |
117 | 120 |
118 void BrowserContextKeyedServiceFactory::RegisterPrefs( | 121 void BrowserContextKeyedServiceFactory::RegisterPrefs( |
119 user_prefs::PrefRegistrySyncable* registry) { | 122 user_prefs::PrefRegistrySyncable* registry) { |
120 RegisterProfilePrefs(registry); | 123 RegisterProfilePrefs(registry); |
121 } | 124 } |
OLD | NEW |