| OLD | NEW |
| (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/push_messaging/push_messaging_permission_context_factor
y.h" | |
| 6 | |
| 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" | |
| 11 | |
| 12 // static | |
| 13 PushMessagingPermissionContext* | |
| 14 PushMessagingPermissionContextFactory::GetForProfile(Profile* profile) { | |
| 15 return static_cast<PushMessagingPermissionContext*>( | |
| 16 GetInstance()->GetServiceForBrowserContext(profile, true)); | |
| 17 } | |
| 18 | |
| 19 // static | |
| 20 PushMessagingPermissionContextFactory* | |
| 21 PushMessagingPermissionContextFactory::GetInstance() { | |
| 22 return base::Singleton<PushMessagingPermissionContextFactory>::get(); | |
| 23 } | |
| 24 | |
| 25 PushMessagingPermissionContextFactory::PushMessagingPermissionContextFactory() | |
| 26 : PermissionContextFactoryBase( | |
| 27 "GCMPermissionContext", | |
| 28 BrowserContextDependencyManager::GetInstance()) {} | |
| 29 | |
| 30 PushMessagingPermissionContextFactory:: | |
| 31 ~PushMessagingPermissionContextFactory() {} | |
| 32 | |
| 33 KeyedService* PushMessagingPermissionContextFactory::BuildServiceInstanceFor( | |
| 34 content::BrowserContext* profile) const { | |
| 35 return new PushMessagingPermissionContext(static_cast<Profile*>(profile)); | |
| 36 } | |
| OLD | NEW |