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

Side by Side Diff: chrome/browser/extensions/api/push_messaging/push_messaging_api_factory.cc

Issue 11682005: Remove some Profile-keyed factory boilerplate: management omnibox preference push_messaging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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
(Empty)
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.
4
5 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api_factor y.h"
6
7 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api.h"
8 #include "chrome/browser/extensions/extension_system_factory.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h"
10 #include "chrome/browser/sync/profile_sync_service_factory.h"
11
12 namespace extensions {
13
14 // static
15 PushMessagingAPI* PushMessagingAPIFactory::GetForProfile(
16 Profile* profile) {
17 return static_cast<PushMessagingAPI*>(
18 GetInstance()->GetServiceForProfile(profile, true));
19 }
20
21 // static
22 PushMessagingAPIFactory* PushMessagingAPIFactory::GetInstance() {
23 return Singleton<PushMessagingAPIFactory>::get();
24 }
25
26 PushMessagingAPIFactory::PushMessagingAPIFactory()
27 : ProfileKeyedServiceFactory("PushMessagingAPI",
28 ProfileDependencyManager::GetInstance()) {
29 DependsOn(extensions::ExtensionSystemFactory::GetInstance());
30 DependsOn(ProfileSyncServiceFactory::GetInstance());
31 }
32
33 PushMessagingAPIFactory::~PushMessagingAPIFactory() {
34 }
35
36 ProfileKeyedService* PushMessagingAPIFactory::BuildServiceInstanceFor(
37 Profile* profile) const {
38 return new PushMessagingAPI(profile);
39 }
40
41 bool PushMessagingAPIFactory::ServiceIsNULLWhileTesting() const {
42 return true;
43 }
44
45 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698