Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / chrome / browser / chrome_to_mobile_service_factory.cc
blobd2c660150e0e2b12b798d309a6fda35b2207b15f
1 // Copyright (c) 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 "chrome/browser/chrome_to_mobile_service_factory.h"
7 #include "chrome/browser/chrome_to_mobile_service.h"
8 #include "chrome/browser/profiles/profile_dependency_manager.h"
9 #include "chrome/browser/signin/token_service_factory.h"
10 #include "chrome/browser/sync/profile_sync_service_factory.h"
12 // static
13 ChromeToMobileServiceFactory* ChromeToMobileServiceFactory::GetInstance() {
14 return Singleton<ChromeToMobileServiceFactory>::get();
17 // static
18 ChromeToMobileService* ChromeToMobileServiceFactory::GetForProfile(
19 Profile* profile) {
20 return static_cast<ChromeToMobileService*>(
21 GetInstance()->GetServiceForProfile(profile, true));
24 ProfileKeyedService* ChromeToMobileServiceFactory::BuildServiceInstanceFor(
25 Profile* profile) const {
26 // Ensure that the service is not instantiated or used if it is disabled.
27 if (!ChromeToMobileService::IsChromeToMobileEnabled())
28 return NULL;
30 return new ChromeToMobileService(profile);
33 ChromeToMobileServiceFactory::ChromeToMobileServiceFactory()
34 : ProfileKeyedServiceFactory("ChromeToMobileService",
35 ProfileDependencyManager::GetInstance()) {
36 DependsOn(ProfileSyncServiceFactory::GetInstance());
37 DependsOn(TokenServiceFactory::GetInstance());
38 // TODO(msw): Uncomment this once it exists.
39 // DependsOn(PrefServiceFactory::GetInstance());
42 ChromeToMobileServiceFactory::~ChromeToMobileServiceFactory() {}