OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import "ios/chrome/browser/signin/authentication_service_factory.h" | 5 #import "ios/chrome/browser/signin/authentication_service_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
11 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 11 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 12 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
13 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" | 13 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" |
14 #import "ios/chrome/browser/signin/authentication_service.h" | 14 #import "ios/chrome/browser/signin/authentication_service.h" |
15 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" | 15 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" |
16 #include "ios/chrome/browser/signin/signin_manager_factory.h" | 16 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
17 #include "ios/chrome/browser/sync/sync_setup_service_factory.h" | 17 #include "ios/chrome/browser/sync/sync_setup_service_factory.h" |
18 | 18 |
| 19 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 20 #error "This file requires ARC support." |
| 21 #endif |
| 22 |
19 // static | 23 // static |
20 AuthenticationService* AuthenticationServiceFactory::GetForBrowserState( | 24 AuthenticationService* AuthenticationServiceFactory::GetForBrowserState( |
21 ios::ChromeBrowserState* browser_state) { | 25 ios::ChromeBrowserState* browser_state) { |
22 return static_cast<AuthenticationService*>( | 26 return static_cast<AuthenticationService*>( |
23 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 27 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
24 } | 28 } |
25 | 29 |
26 AuthenticationService* AuthenticationServiceFactory::GetForBrowserStateIfExists( | 30 AuthenticationService* AuthenticationServiceFactory::GetForBrowserStateIfExists( |
27 ios::ChromeBrowserState* browser_state) { | 31 ios::ChromeBrowserState* browser_state) { |
28 return static_cast<AuthenticationService*>( | 32 return static_cast<AuthenticationService*>( |
(...skipping 30 matching lines...) Expand all Loading... |
59 SyncSetupServiceFactory::GetForBrowserState(browser_state))); | 63 SyncSetupServiceFactory::GetForBrowserState(browser_state))); |
60 service->Initialize(); | 64 service->Initialize(); |
61 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. | 65 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. |
62 return std::move(service); | 66 return std::move(service); |
63 } | 67 } |
64 | 68 |
65 void AuthenticationServiceFactory::RegisterBrowserStatePrefs( | 69 void AuthenticationServiceFactory::RegisterBrowserStatePrefs( |
66 user_prefs::PrefRegistrySyncable* registry) { | 70 user_prefs::PrefRegistrySyncable* registry) { |
67 AuthenticationService::RegisterPrefs(registry); | 71 AuthenticationService::RegisterPrefs(registry); |
68 } | 72 } |
OLD | NEW |