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"
13 PushMessagingPermissionContext
*
14 PushMessagingPermissionContextFactory::GetForProfile(
16 return static_cast<PushMessagingPermissionContext
*>(
17 GetInstance()->GetServiceForBrowserContext(profile
, true));
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
));