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

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

Issue 955673004: Move gcm-independent parts of push messaging out of gcm namespace and directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove redundant cast Created 5 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2014 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/services/gcm/push_messaging_permission_context_factory. h"
6
7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/services/gcm/push_messaging_permission_context.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11
12 namespace gcm {
13
14 // static
15 PushMessagingPermissionContext*
16 PushMessagingPermissionContextFactory::GetForProfile(
17 Profile* profile) {
18 return static_cast<PushMessagingPermissionContext*>(
19 GetInstance()->GetServiceForBrowserContext(profile, true));
20 }
21
22 // static
23 PushMessagingPermissionContextFactory*
24 PushMessagingPermissionContextFactory::GetInstance() {
25 return Singleton<PushMessagingPermissionContextFactory>::get();
26 }
27
28 PushMessagingPermissionContextFactory::PushMessagingPermissionContextFactory()
29 : BrowserContextKeyedServiceFactory(
30 "GCMPermissionContext",
31 BrowserContextDependencyManager::GetInstance()) {
32 }
33
34 PushMessagingPermissionContextFactory
35 ::~PushMessagingPermissionContextFactory() {
36 }
37
38 KeyedService* PushMessagingPermissionContextFactory::BuildServiceInstanceFor(
39 content::BrowserContext* profile) const {
40 return new PushMessagingPermissionContext(static_cast<Profile*>(profile));
41 }
42
43 content::BrowserContext*
44 PushMessagingPermissionContextFactory::GetBrowserContextToUse(
45 content::BrowserContext* context) const {
46 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
47 }
48
49 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698