Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: chrome/browser/chrome_to_mobile_service_factory.cc

Issue 17911005: Merge 208347 "Revert 208315 "Make use of InvalidationService"" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1547/src/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/chrome_to_mobile_service_factory.h" 5 #include "chrome/browser/chrome_to_mobile_service_factory.h"
6 6
7 #include "chrome/browser/chrome_to_mobile_service.h" 7 #include "chrome/browser/chrome_to_mobile_service.h"
8 #include "chrome/browser/invalidation/invalidation_service_factory.h"
9 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/token_service_factory.h" 9 #include "chrome/browser/signin/token_service_factory.h"
10 #include "chrome/browser/sync/profile_sync_service_factory.h"
11 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 11 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
12 12
13 // static 13 // static
14 ChromeToMobileServiceFactory* ChromeToMobileServiceFactory::GetInstance() { 14 ChromeToMobileServiceFactory* ChromeToMobileServiceFactory::GetInstance() {
15 return Singleton<ChromeToMobileServiceFactory>::get(); 15 return Singleton<ChromeToMobileServiceFactory>::get();
16 } 16 }
17 17
18 // static 18 // static
19 ChromeToMobileService* ChromeToMobileServiceFactory::GetForProfile( 19 ChromeToMobileService* ChromeToMobileServiceFactory::GetForProfile(
20 Profile* profile) { 20 Profile* profile) {
21 return static_cast<ChromeToMobileService*>( 21 return static_cast<ChromeToMobileService*>(
22 GetInstance()->GetServiceForBrowserContext(profile, true)); 22 GetInstance()->GetServiceForBrowserContext(profile, true));
23 } 23 }
24 24
25 BrowserContextKeyedService* 25 BrowserContextKeyedService*
26 ChromeToMobileServiceFactory::BuildServiceInstanceFor( 26 ChromeToMobileServiceFactory::BuildServiceInstanceFor(
27 content::BrowserContext* profile) const { 27 content::BrowserContext* profile) const {
28 // Ensure that the service is not instantiated or used if it is disabled. 28 // Ensure that the service is not instantiated or used if it is disabled.
29 if (!ChromeToMobileService::IsChromeToMobileEnabled()) 29 if (!ChromeToMobileService::IsChromeToMobileEnabled())
30 return NULL; 30 return NULL;
31 31
32 return new ChromeToMobileService(static_cast<Profile*>(profile)); 32 return new ChromeToMobileService(static_cast<Profile*>(profile));
33 } 33 }
34 34
35 ChromeToMobileServiceFactory::ChromeToMobileServiceFactory() 35 ChromeToMobileServiceFactory::ChromeToMobileServiceFactory()
36 : BrowserContextKeyedServiceFactory( 36 : BrowserContextKeyedServiceFactory(
37 "ChromeToMobileService", 37 "ChromeToMobileService",
38 BrowserContextDependencyManager::GetInstance()) { 38 BrowserContextDependencyManager::GetInstance()) {
39 DependsOn(invalidation::InvalidationServiceFactory::GetInstance()); 39 DependsOn(ProfileSyncServiceFactory::GetInstance());
40 DependsOn(TokenServiceFactory::GetInstance()); 40 DependsOn(TokenServiceFactory::GetInstance());
41 // TODO(msw): Uncomment this once it exists. 41 // TODO(msw): Uncomment this once it exists.
42 // DependsOn(PrefServiceFactory::GetInstance()); 42 // DependsOn(PrefServiceFactory::GetInstance());
43 } 43 }
44 44
45 ChromeToMobileServiceFactory::~ChromeToMobileServiceFactory() {} 45 ChromeToMobileServiceFactory::~ChromeToMobileServiceFactory() {}
OLDNEW
« no previous file with comments | « chrome/browser/chrome_to_mobile_service.cc ('k') | chrome/browser/drive/drive_notification_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698