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

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

Issue 286213003: Make GCMProfileService own GCMDriver, instead of deriving from it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 6 years, 7 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 "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/profiles/incognito_helpers.h" 8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/services/gcm/gcm_profile_service.h" 10 #include "chrome/browser/services/gcm/gcm_profile_service.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #if !defined(OS_ANDROID) 43 #if !defined(OS_ANDROID)
44 DependsOn(LoginUIServiceFactory::GetInstance()); 44 DependsOn(LoginUIServiceFactory::GetInstance());
45 #endif 45 #endif
46 } 46 }
47 47
48 GCMProfileServiceFactory::~GCMProfileServiceFactory() { 48 GCMProfileServiceFactory::~GCMProfileServiceFactory() {
49 } 49 }
50 50
51 KeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor( 51 KeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor(
52 content::BrowserContext* context) const { 52 content::BrowserContext* context) const {
53 Profile* profile = static_cast<Profile*>(context); 53 return new GCMProfileService(
54 GCMProfileService* service = new GCMProfileService(profile); 54 Profile::FromBrowserContext(context),
55 scoped_ptr<GCMClientFactory> gcm_client_factory(new GCMClientFactory); 55 scoped_ptr<GCMClientFactory>(new GCMClientFactory));
56 service->Initialize(gcm_client_factory.Pass());
57 return service;
58 } 56 }
59 57
60 content::BrowserContext* GCMProfileServiceFactory::GetBrowserContextToUse( 58 content::BrowserContext* GCMProfileServiceFactory::GetBrowserContextToUse(
61 content::BrowserContext* context) const { 59 content::BrowserContext* context) const {
62 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 60 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
63 } 61 }
64 62
65 } // namespace gcm 63 } // namespace gcm
OLDNEW
« no previous file with comments | « chrome/browser/services/gcm/gcm_profile_service.cc ('k') | chrome/browser/services/gcm/gcm_profile_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698