| Index: components/keyed_service/ios/browser_state_keyed_service_factory.cc
|
| diff --git a/components/keyed_service/ios/browser_state_keyed_service_factory.cc b/components/keyed_service/ios/browser_state_keyed_service_factory.cc
|
| index 3d2b751fc3934c01aa8a2bc305b2ec89d2ed0044..3c1f83e87060e11e65d08c57aee16265b8423236 100644
|
| --- a/components/keyed_service/ios/browser_state_keyed_service_factory.cc
|
| +++ b/components/keyed_service/ios/browser_state_keyed_service_factory.cc
|
| @@ -5,12 +5,9 @@
|
| #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
|
|
|
| #include "base/logging.h"
|
| -#include "base/prefs/pref_service.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
| #include "components/keyed_service/ios/browser_state_dependency_manager.h"
|
| #include "components/keyed_service/ios/browser_state_helper.h"
|
| -#include "components/pref_registry/pref_registry_syncable.h"
|
| -#include "components/user_prefs/user_prefs.h"
|
| #include "ios/web/public/browser_state.h"
|
|
|
| void BrowserStateKeyedServiceFactory::SetTestingFactory(
|
| @@ -79,30 +76,29 @@ void BrowserStateKeyedServiceFactory::BrowserStateDestroyed(
|
|
|
| KeyedService* BrowserStateKeyedServiceFactory::BuildServiceInstanceFor(
|
| base::SupportsUserData* context) const {
|
| - return BuildServiceInstanceFor(BrowserStateFromContext(context));
|
| + return BuildServiceInstanceFor(UnderlyingContextFromContext(context));
|
| }
|
|
|
| bool BrowserStateKeyedServiceFactory::IsOffTheRecord(
|
| base::SupportsUserData* context) const {
|
| - return BrowserStateFromContext(context)->IsOffTheRecord();
|
| + return UnderlyingContextFromContext(context)->IsOffTheRecord();
|
| }
|
|
|
| -user_prefs::PrefRegistrySyncable*
|
| -BrowserStateKeyedServiceFactory::GetAssociatedPrefRegistry(
|
| +base::SupportsUserData*
|
| +BrowserStateKeyedServiceFactory::GetUnderlyingContextInternal(
|
| base::SupportsUserData* context) const {
|
| - // TODO(droger): Move this code to KeyedServiceFactory and share it with the
|
| - // other platforms once iOS no longer needs BrowserStateFromContext().
|
| - PrefService* prefs =
|
| - user_prefs::UserPrefs::Get(BrowserStateFromContext(context));
|
| - user_prefs::PrefRegistrySyncable* registry =
|
| - static_cast<user_prefs::PrefRegistrySyncable*>(
|
| - prefs->DeprecatedGetPrefRegistry());
|
| - return registry;
|
| + return UnderlyingContextFromContext(context);
|
| +}
|
| +
|
| +base::SupportsUserData*
|
| +BrowserStateKeyedServiceFactory::GetOriginalContextInternal(
|
| + base::SupportsUserData* context) const {
|
| + return OriginalContextFromContext(context);
|
| }
|
|
|
| base::SupportsUserData* BrowserStateKeyedServiceFactory::GetContextToUse(
|
| base::SupportsUserData* context) const {
|
| - return GetBrowserStateToUse(BrowserStateFromContext(context));
|
| + return GetBrowserStateToUse(UnderlyingContextFromContext(context));
|
| }
|
|
|
| bool BrowserStateKeyedServiceFactory::ServiceIsCreatedWithContext() const {
|
| @@ -111,15 +107,15 @@ bool BrowserStateKeyedServiceFactory::ServiceIsCreatedWithContext() const {
|
|
|
| void BrowserStateKeyedServiceFactory::ContextShutdown(
|
| base::SupportsUserData* context) {
|
| - BrowserStateShutdown(BrowserStateFromContext(context));
|
| + BrowserStateShutdown(UnderlyingContextFromContext(context));
|
| }
|
|
|
| void BrowserStateKeyedServiceFactory::ContextDestroyed(
|
| base::SupportsUserData* context) {
|
| - BrowserStateDestroyed(BrowserStateFromContext(context));
|
| + BrowserStateDestroyed(UnderlyingContextFromContext(context));
|
| }
|
|
|
| void BrowserStateKeyedServiceFactory::RegisterPrefs(
|
| user_prefs::PrefRegistrySyncable* registry) {
|
| - RegisterProfilePrefs(registry);
|
| + RegisterBrowserStatePrefs(registry);
|
| }
|
|
|