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_manager_factory.h" | 5 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
8 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/time/time.h" | 11 #include "base/time/time.h" |
10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 12 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
11 #include "components/pref_registry/pref_registry_syncable.h" | 13 #include "components/pref_registry/pref_registry_syncable.h" |
12 #include "components/signin/core/browser/signin_manager.h" | 14 #include "components/signin/core/browser/signin_manager.h" |
13 #include "components/signin/core/common/signin_pref_names.h" | 15 #include "components/signin/core/common/signin_pref_names.h" |
14 #include "ios/chrome/browser/application_context.h" | 16 #include "ios/chrome/browser/application_context.h" |
15 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" | 17 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" |
16 #include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h" | 18 #include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 scoped_ptr<SigninManager> service(new SigninManager( | 86 scoped_ptr<SigninManager> service(new SigninManager( |
85 SigninClientFactory::GetForBrowserState(chrome_browser_state), | 87 SigninClientFactory::GetForBrowserState(chrome_browser_state), |
86 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), | 88 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), |
87 ios::AccountTrackerServiceFactory::GetForBrowserState( | 89 ios::AccountTrackerServiceFactory::GetForBrowserState( |
88 chrome_browser_state), | 90 chrome_browser_state), |
89 ios::GaiaCookieManagerServiceFactory::GetForBrowserState( | 91 ios::GaiaCookieManagerServiceFactory::GetForBrowserState( |
90 chrome_browser_state))); | 92 chrome_browser_state))); |
91 service->Initialize(GetApplicationContext()->GetLocalState()); | 93 service->Initialize(GetApplicationContext()->GetLocalState()); |
92 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_, | 94 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_, |
93 SigninManagerCreated(service.get())); | 95 SigninManagerCreated(service.get())); |
94 return service.Pass(); | 96 return std::move(service); |
95 } | 97 } |
96 | 98 |
97 void SigninManagerFactory::BrowserStateShutdown(web::BrowserState* context) { | 99 void SigninManagerFactory::BrowserStateShutdown(web::BrowserState* context) { |
98 SigninManager* manager = | 100 SigninManager* manager = |
99 static_cast<SigninManager*>(GetServiceForBrowserState(context, false)); | 101 static_cast<SigninManager*>(GetServiceForBrowserState(context, false)); |
100 if (manager) | 102 if (manager) |
101 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_, | 103 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_, |
102 SigninManagerShutdown(manager)); | 104 SigninManagerShutdown(manager)); |
103 BrowserStateKeyedServiceFactory::BrowserStateShutdown(context); | 105 BrowserStateKeyedServiceFactory::BrowserStateShutdown(context); |
104 } | 106 } |
105 | 107 |
106 } // namespace ios | 108 } // namespace ios |
OLD | NEW |