cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / ios / chrome / browser / signin / account_consistency_service_factory.h
blobe0e8b67b83fe16b3f087f75b475aa4e57e5f5d2c
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
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_CONSISTENCY_SERVICE_FACTORY_H_
6 #define IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_CONSISTENCY_SERVICE_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
12 template <typename T>
13 struct DefaultSingletonTraits;
14 class AccountConsistencyService;
16 namespace ios {
18 class ChromeBrowserState;
20 // Singleton that owns the AccountConsistencyService(s) and associates them with
21 // browser states.
22 class AccountConsistencyServiceFactory
23 : public BrowserStateKeyedServiceFactory {
24 public:
25 // Returns the instance of AccountConsistencyService associated with this
26 // browser state (creating one if none exists). Returns null if this browser
27 // state cannot have an AccountConsistencyService (for example, if it is
28 // incognito or if WKWebView is not enabled).
29 static AccountConsistencyService* GetForBrowserState(
30 ios::ChromeBrowserState* browser_state);
32 // Returns an instance of the factory singleton.
33 static AccountConsistencyServiceFactory* GetInstance();
35 private:
36 friend struct DefaultSingletonTraits<AccountConsistencyServiceFactory>;
38 AccountConsistencyServiceFactory();
39 ~AccountConsistencyServiceFactory() override;
41 // BrowserStateKeyedServiceFactory:
42 void RegisterBrowserStatePrefs(
43 user_prefs::PrefRegistrySyncable* registry) override;
44 scoped_ptr<KeyedService> BuildServiceInstanceFor(
45 web::BrowserState* context) const override;
46 bool ServiceIsCreatedWithBrowserState() const override;
48 DISALLOW_COPY_AND_ASSIGN(AccountConsistencyServiceFactory);
51 } // namespace ios
53 #endif // IOS_CHROME_BROWSER_SIGNIN_ACCOUNT_CONSISTENCY_SERVICE_FACTORY_H_