Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / push_messaging / push_messaging_permission_context_factory.cc
blobad2855a9ed192761b3d114a3c32b2e0b49d4e7e6
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 Singleton<PushMessagingPermissionContextFactory>::get();
26 PushMessagingPermissionContextFactory::PushMessagingPermissionContextFactory()
27 : BrowserContextKeyedServiceFactory(
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));
41 content::BrowserContext*
42 PushMessagingPermissionContextFactory::GetBrowserContextToUse(
43 content::BrowserContext* context) const {
44 return chrome::GetBrowserContextOwnInstanceInIncognito(context);