ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / bookmarks / startup_task_runner_service_factory.cc
blobd252e61f9d5a37be8515284df06af573025ddf3d
1 // Copyright (c) 2013 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 "chrome/browser/bookmarks/startup_task_runner_service_factory.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "components/bookmarks/browser/startup_task_runner_service.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 using bookmarks::StartupTaskRunnerService;
13 StartupTaskRunnerServiceFactory::StartupTaskRunnerServiceFactory()
14 : BrowserContextKeyedServiceFactory(
15 "StartupTaskRunnerServiceFactory",
16 BrowserContextDependencyManager::GetInstance()) {
19 StartupTaskRunnerServiceFactory::~StartupTaskRunnerServiceFactory() {}
21 // static
22 StartupTaskRunnerService* StartupTaskRunnerServiceFactory::GetForProfile(
23 Profile* profile) {
24 return static_cast<StartupTaskRunnerService*>(
25 GetInstance()->GetServiceForBrowserContext(profile, true));
28 // static
29 StartupTaskRunnerServiceFactory*
30 StartupTaskRunnerServiceFactory::GetInstance() {
31 return Singleton<StartupTaskRunnerServiceFactory>::get();
34 KeyedService* StartupTaskRunnerServiceFactory::BuildServiceInstanceFor(
35 content::BrowserContext* context) const {
36 Profile* profile = Profile::FromBrowserContext(context);
37 return new StartupTaskRunnerService(profile->GetIOTaskRunner());