| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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/background_sync/background_sync_permission_context_fact
ory.h" | |
| 6 | |
| 7 #include "chrome/browser/background_sync/background_sync_permission_context.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
| 10 | |
| 11 // static | |
| 12 BackgroundSyncPermissionContext* | |
| 13 BackgroundSyncPermissionContextFactory::GetForProfile(Profile* profile) { | |
| 14 return static_cast<BackgroundSyncPermissionContext*>( | |
| 15 GetInstance()->GetServiceForBrowserContext(profile, true /* create */)); | |
| 16 } | |
| 17 | |
| 18 // static | |
| 19 BackgroundSyncPermissionContextFactory* | |
| 20 BackgroundSyncPermissionContextFactory::GetInstance() { | |
| 21 return base::Singleton<BackgroundSyncPermissionContextFactory>::get(); | |
| 22 } | |
| 23 | |
| 24 BackgroundSyncPermissionContextFactory::BackgroundSyncPermissionContextFactory() | |
| 25 : PermissionContextFactoryBase( | |
| 26 "BackgroundSyncPermissionContext", | |
| 27 BrowserContextDependencyManager::GetInstance()) {} | |
| 28 | |
| 29 KeyedService* BackgroundSyncPermissionContextFactory::BuildServiceInstanceFor( | |
| 30 content::BrowserContext* profile) const { | |
| 31 return new BackgroundSyncPermissionContext(static_cast<Profile*>(profile)); | |
| 32 } | |
| OLD | NEW |