cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / ios / chrome / browser / sync / sync_setup_service_factory.cc
blobedbf9ac2a0229f016e529e2f4abce15f901f2269
1 // Copyright 2012 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 #include "ios/chrome/browser/sync/sync_setup_service_factory.h"
7 #include "base/memory/singleton.h"
8 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
9 #include "ios/chrome/browser/sync/sync_setup_service.h"
10 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
11 #include "ios/public/provider/chrome/browser/keyed_service_provider.h"
13 // static
14 SyncSetupService* SyncSetupServiceFactory::GetForBrowserState(
15 ios::ChromeBrowserState* browser_state) {
16 return static_cast<SyncSetupService*>(
17 GetInstance()->GetServiceForBrowserState(browser_state, true));
20 // static
21 SyncSetupService* SyncSetupServiceFactory::GetForBrowserStateIfExists(
22 ios::ChromeBrowserState* browser_state) {
23 return static_cast<SyncSetupService*>(
24 GetInstance()->GetServiceForBrowserState(browser_state, false));
27 // static
28 SyncSetupServiceFactory* SyncSetupServiceFactory::GetInstance() {
29 return Singleton<SyncSetupServiceFactory>::get();
32 SyncSetupServiceFactory::SyncSetupServiceFactory()
33 : BrowserStateKeyedServiceFactory(
34 "SyncSetupService",
35 BrowserStateDependencyManager::GetInstance()) {
36 DependsOn(ios::GetKeyedServiceProvider()->GetSyncServiceFactory());
39 SyncSetupServiceFactory::~SyncSetupServiceFactory() {
42 scoped_ptr<KeyedService> SyncSetupServiceFactory::BuildServiceInstanceFor(
43 web::BrowserState* context) const {
44 ios::ChromeBrowserState* browser_state =
45 ios::ChromeBrowserState::FromBrowserState(context);
46 return make_scoped_ptr(new SyncSetupService(
47 ios::GetKeyedServiceProvider()->GetSyncServiceForBrowserState(
48 browser_state),
49 browser_state->GetPrefs()));