| 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> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 std::unique_ptr<SigninManager> service(new SigninManager( | 86 std::unique_ptr<SigninManager> service(new SigninManager( |
| 87 SigninClientFactory::GetForBrowserState(chrome_browser_state), | 87 SigninClientFactory::GetForBrowserState(chrome_browser_state), |
| 88 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), | 88 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), |
| 89 ios::AccountTrackerServiceFactory::GetForBrowserState( | 89 ios::AccountTrackerServiceFactory::GetForBrowserState( |
| 90 chrome_browser_state), | 90 chrome_browser_state), |
| 91 ios::GaiaCookieManagerServiceFactory::GetForBrowserState( | 91 ios::GaiaCookieManagerServiceFactory::GetForBrowserState( |
| 92 chrome_browser_state))); | 92 chrome_browser_state))); |
| 93 service->Initialize(GetApplicationContext()->GetLocalState()); | 93 service->Initialize(GetApplicationContext()->GetLocalState()); |
| 94 for (auto& observer : observer_list_) | 94 for (auto& observer : observer_list_) |
| 95 observer.SigninManagerCreated(service.get()); | 95 observer.SigninManagerCreated(service.get()); |
| 96 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. |
| 96 return std::move(service); | 97 return std::move(service); |
| 97 } | 98 } |
| 98 | 99 |
| 99 void SigninManagerFactory::BrowserStateShutdown(web::BrowserState* context) { | 100 void SigninManagerFactory::BrowserStateShutdown(web::BrowserState* context) { |
| 100 SigninManager* manager = | 101 SigninManager* manager = |
| 101 static_cast<SigninManager*>(GetServiceForBrowserState(context, false)); | 102 static_cast<SigninManager*>(GetServiceForBrowserState(context, false)); |
| 102 if (manager) { | 103 if (manager) { |
| 103 for (auto& observer : observer_list_) | 104 for (auto& observer : observer_list_) |
| 104 observer.SigninManagerShutdown(manager); | 105 observer.SigninManagerShutdown(manager); |
| 105 } | 106 } |
| 106 BrowserStateKeyedServiceFactory::BrowserStateShutdown(context); | 107 BrowserStateKeyedServiceFactory::BrowserStateShutdown(context); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace ios | 110 } // namespace ios |
| OLD | NEW |