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_base_factory.h" | 5 #include "components/keyed_service/content/browser_context_keyed_base_factory.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.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/pref_registry/pref_registry_syncable.h" | 9 #include "components/pref_registry/pref_registry_syncable.h" |
10 #include "components/user_prefs/user_prefs.h" | 10 #include "components/user_prefs/user_prefs.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 void BrowserContextKeyedBaseFactory::BrowserContextDestroyed( | 51 void BrowserContextKeyedBaseFactory::BrowserContextDestroyed( |
52 content::BrowserContext* context) { | 52 content::BrowserContext* context) { |
53 KeyedServiceBaseFactory::ContextDestroyed(context); | 53 KeyedServiceBaseFactory::ContextDestroyed(context); |
54 } | 54 } |
55 | 55 |
56 user_prefs::PrefRegistrySyncable* | 56 user_prefs::PrefRegistrySyncable* |
57 BrowserContextKeyedBaseFactory::GetAssociatedPrefRegistry( | 57 BrowserContextKeyedBaseFactory::GetAssociatedPrefRegistry( |
58 base::SupportsUserData* context) const { | 58 base::SupportsUserData* context) const { |
59 PrefService* prefs = user_prefs::UserPrefs::Get( | 59 PrefService* prefs = user_prefs::UserPrefs::Get(context); |
60 static_cast<content::BrowserContext*>(context)); | |
61 user_prefs::PrefRegistrySyncable* registry = | 60 user_prefs::PrefRegistrySyncable* registry = |
62 static_cast<user_prefs::PrefRegistrySyncable*>( | 61 static_cast<user_prefs::PrefRegistrySyncable*>( |
63 prefs->DeprecatedGetPrefRegistry()); | 62 prefs->DeprecatedGetPrefRegistry()); |
64 return registry; | 63 return registry; |
65 } | 64 } |
66 | 65 |
67 base::SupportsUserData* BrowserContextKeyedBaseFactory::GetContextToUse( | 66 base::SupportsUserData* BrowserContextKeyedBaseFactory::GetContextToUse( |
68 base::SupportsUserData* context) const { | 67 base::SupportsUserData* context) const { |
69 return GetBrowserContextToUse(static_cast<content::BrowserContext*>(context)); | 68 return GetBrowserContextToUse(static_cast<content::BrowserContext*>(context)); |
70 } | 69 } |
(...skipping 24 matching lines...) Expand all Loading... |
95 | 94 |
96 bool BrowserContextKeyedBaseFactory::HasTestingFactory( | 95 bool BrowserContextKeyedBaseFactory::HasTestingFactory( |
97 base::SupportsUserData* context) { | 96 base::SupportsUserData* context) { |
98 return HasTestingFactory(static_cast<content::BrowserContext*>(context)); | 97 return HasTestingFactory(static_cast<content::BrowserContext*>(context)); |
99 } | 98 } |
100 | 99 |
101 void BrowserContextKeyedBaseFactory::CreateServiceNow( | 100 void BrowserContextKeyedBaseFactory::CreateServiceNow( |
102 base::SupportsUserData* context) { | 101 base::SupportsUserData* context) { |
103 CreateServiceNow(static_cast<content::BrowserContext*>(context)); | 102 CreateServiceNow(static_cast<content::BrowserContext*>(context)); |
104 } | 103 } |
OLD | NEW |