| 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/ios/browser_state_keyed_service_factory.h" | 5 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/keyed_service/core/keyed_service.h" | 8 #include "components/keyed_service/core/keyed_service.h" |
| 9 #include "components/keyed_service/ios/browser_state_context_converter.h" | 9 #include "components/keyed_service/ios/browser_state_context_converter.h" |
| 10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void BrowserStateKeyedServiceFactory::BrowserStateShutdown( | 67 void BrowserStateKeyedServiceFactory::BrowserStateShutdown( |
| 68 web::BrowserState* context) { | 68 web::BrowserState* context) { |
| 69 KeyedServiceFactory::ContextShutdown(context); | 69 KeyedServiceFactory::ContextShutdown(context); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void BrowserStateKeyedServiceFactory::BrowserStateDestroyed( | 72 void BrowserStateKeyedServiceFactory::BrowserStateDestroyed( |
| 73 web::BrowserState* context) { | 73 web::BrowserState* context) { |
| 74 KeyedServiceFactory::ContextDestroyed(context); | 74 KeyedServiceFactory::ContextDestroyed(context); |
| 75 } | 75 } |
| 76 | 76 |
| 77 KeyedService* BrowserStateKeyedServiceFactory::BuildServiceInstanceFor( | 77 scoped_ptr<KeyedService> |
| 78 BrowserStateKeyedServiceFactory::BuildServiceInstanceFor( |
| 78 base::SupportsUserData* context) const { | 79 base::SupportsUserData* context) const { |
| 79 return BuildServiceInstanceFor(static_cast<web::BrowserState*>(context)); | 80 // TODO(isherman): The wrapped BuildServiceInstanceFor() should return a |
| 81 // scoped_ptr as well. |
| 82 return make_scoped_ptr( |
| 83 BuildServiceInstanceFor(static_cast<web::BrowserState*>(context))); |
| 80 } | 84 } |
| 81 | 85 |
| 82 bool BrowserStateKeyedServiceFactory::IsOffTheRecord( | 86 bool BrowserStateKeyedServiceFactory::IsOffTheRecord( |
| 83 base::SupportsUserData* context) const { | 87 base::SupportsUserData* context) const { |
| 84 return static_cast<web::BrowserState*>(context)->IsOffTheRecord(); | 88 return static_cast<web::BrowserState*>(context)->IsOffTheRecord(); |
| 85 } | 89 } |
| 86 | 90 |
| 87 #if defined(OS_IOS) | 91 #if defined(OS_IOS) |
| 88 base::SupportsUserData* BrowserStateKeyedServiceFactory::GetTypedContext( | 92 base::SupportsUserData* BrowserStateKeyedServiceFactory::GetTypedContext( |
| 89 base::SupportsUserData* context) const { | 93 base::SupportsUserData* context) const { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 133 |
| 130 void BrowserStateKeyedServiceFactory::ContextDestroyed( | 134 void BrowserStateKeyedServiceFactory::ContextDestroyed( |
| 131 base::SupportsUserData* context) { | 135 base::SupportsUserData* context) { |
| 132 BrowserStateDestroyed(static_cast<web::BrowserState*>(context)); | 136 BrowserStateDestroyed(static_cast<web::BrowserState*>(context)); |
| 133 } | 137 } |
| 134 | 138 |
| 135 void BrowserStateKeyedServiceFactory::RegisterPrefs( | 139 void BrowserStateKeyedServiceFactory::RegisterPrefs( |
| 136 user_prefs::PrefRegistrySyncable* registry) { | 140 user_prefs::PrefRegistrySyncable* registry) { |
| 137 RegisterBrowserStatePrefs(registry); | 141 RegisterBrowserStatePrefs(registry); |
| 138 } | 142 } |
| OLD | NEW |