| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/signin/signin_error_controller_factory.h" | 5 #include "ios/chrome/browser/signin/signin_error_controller_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
| 7 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 8 #include "components/keyed_service/core/service_access_type.h" | 9 #include "components/keyed_service/core/service_access_type.h" |
| 9 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
| 10 #include "components/signin/core/browser/signin_error_controller.h" | 11 #include "components/signin/core/browser/signin_error_controller.h" |
| 11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 12 | 13 |
| 13 namespace ios { | 14 namespace ios { |
| 14 | 15 |
| 15 // static | 16 // static |
| 16 SigninErrorController* SigninErrorControllerFactory::GetForBrowserState( | 17 SigninErrorController* SigninErrorControllerFactory::GetForBrowserState( |
| 17 ios::ChromeBrowserState* browser_state) { | 18 ios::ChromeBrowserState* browser_state) { |
| 18 return static_cast<SigninErrorController*>( | 19 return static_cast<SigninErrorController*>( |
| 19 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 20 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
| 20 } | 21 } |
| 21 | 22 |
| 22 // static | 23 // static |
| 23 SigninErrorControllerFactory* SigninErrorControllerFactory::GetInstance() { | 24 SigninErrorControllerFactory* SigninErrorControllerFactory::GetInstance() { |
| 24 return base::Singleton<SigninErrorControllerFactory>::get(); | 25 return base::Singleton<SigninErrorControllerFactory>::get(); |
| 25 } | 26 } |
| 26 | 27 |
| 27 SigninErrorControllerFactory::SigninErrorControllerFactory() | 28 SigninErrorControllerFactory::SigninErrorControllerFactory() |
| 28 : BrowserStateKeyedServiceFactory( | 29 : BrowserStateKeyedServiceFactory( |
| 29 "SigninErrorController", | 30 "SigninErrorController", |
| 30 BrowserStateDependencyManager::GetInstance()) { | 31 BrowserStateDependencyManager::GetInstance()) { |
| 31 } | 32 } |
| 32 | 33 |
| 33 SigninErrorControllerFactory::~SigninErrorControllerFactory() { | 34 SigninErrorControllerFactory::~SigninErrorControllerFactory() { |
| 34 } | 35 } |
| 35 | 36 |
| 36 scoped_ptr<KeyedService> SigninErrorControllerFactory::BuildServiceInstanceFor( | 37 std::unique_ptr<KeyedService> |
| 38 SigninErrorControllerFactory::BuildServiceInstanceFor( |
| 37 web::BrowserState* context) const { | 39 web::BrowserState* context) const { |
| 38 return make_scoped_ptr(new SigninErrorController); | 40 return base::WrapUnique(new SigninErrorController); |
| 39 } | 41 } |
| 40 | 42 |
| 41 } // namespace ios | 43 } // namespace ios |
| OLD | NEW |