Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / push_messaging / push_messaging_permission_context_factory.cc
blob282c5e220b986593820adc5f41a444fe3eeae4c3
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.
5 #include "chrome/browser/push_messaging/push_messaging_permission_context_factory.h"
7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/push_messaging/push_messaging_permission_context.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 // static
13 PushMessagingPermissionContext*
14 PushMessagingPermissionContextFactory::GetForProfile(
15 Profile* profile) {
16 return static_cast<PushMessagingPermissionContext*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true));
20 // static
21 PushMessagingPermissionContextFactory*
22 PushMessagingPermissionContextFactory::GetInstance() {
23 return base::Singleton<PushMessagingPermissionContextFactory>::get();
26 PushMessagingPermissionContextFactory::PushMessagingPermissionContextFactory()
27 : PermissionContextFactoryBase(
28 "GCMPermissionContext",
29 BrowserContextDependencyManager::GetInstance()) {
32 PushMessagingPermissionContextFactory
33 ::~PushMessagingPermissionContextFactory() {
36 KeyedService* PushMessagingPermissionContextFactory::BuildServiceInstanceFor(
37 content::BrowserContext* profile) const {
38 return new PushMessagingPermissionContext(static_cast<Profile*>(profile));