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

Side by Side Diff: chrome/browser/services/gcm/gcm_profile_service_factory.cc

Issue 165993005: [GCM] Make sure GCM checkout logic is invoked when the profile is signed out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address more feedback Created 6 years, 10 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) 2013 The Chromium Authors. All rights reserved. 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 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/services/gcm/gcm_profile_service_factory.h" 5 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
6 6
7 #include "chrome/browser/profiles/incognito_helpers.h" 7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/services/gcm/gcm_client_factory.h" 9 #include "chrome/browser/services/gcm/gcm_client_factory.h"
10 #include "chrome/browser/services/gcm/gcm_profile_service.h" 10 #include "chrome/browser/services/gcm/gcm_profile_service.h"
(...skipping 20 matching lines...) Expand all
31 "GCMProfileService", 31 "GCMProfileService",
32 BrowserContextDependencyManager::GetInstance()) { 32 BrowserContextDependencyManager::GetInstance()) {
33 } 33 }
34 34
35 GCMProfileServiceFactory::~GCMProfileServiceFactory() { 35 GCMProfileServiceFactory::~GCMProfileServiceFactory() {
36 } 36 }
37 37
38 BrowserContextKeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor( 38 BrowserContextKeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor(
39 content::BrowserContext* context) const { 39 content::BrowserContext* context) const {
40 Profile* profile = static_cast<Profile*>(context); 40 Profile* profile = static_cast<Profile*>(context);
41 if (!gcm::GCMProfileService::IsGCMEnabled(profile))
42 return NULL;
43 GCMProfileService* service = new GCMProfileService(profile); 41 GCMProfileService* service = new GCMProfileService(profile);
44 scoped_ptr<GCMClientFactory> gcm_client_factory(new GCMClientFactory); 42 scoped_ptr<GCMClientFactory> gcm_client_factory(new GCMClientFactory);
45 service->Initialize(gcm_client_factory.Pass()); 43 service->Initialize(gcm_client_factory.Pass());
46 return service; 44 return service;
47 } 45 }
48 46
49 content::BrowserContext* GCMProfileServiceFactory::GetBrowserContextToUse( 47 content::BrowserContext* GCMProfileServiceFactory::GetBrowserContextToUse(
50 content::BrowserContext* context) const { 48 content::BrowserContext* context) const {
51 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 49 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
52 } 50 }
53 51
54 } // namespace gcm 52 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698