privet_notifications_factory.cc revision 68043e1e95eeb07d5cae7aca370b26518b0867d6
1// Copyright 2013 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/local_discovery/privet_notifications_factory.h" 6 7#include "chrome/browser/browser_process.h" 8#include "chrome/browser/local_discovery/privet_notifications.h" 9#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" 10 11namespace local_discovery { 12 13PrivetNotificationServiceFactory* 14PrivetNotificationServiceFactory::GetInstance() { 15 return Singleton<PrivetNotificationServiceFactory>::get(); 16} 17 18PrivetNotificationServiceFactory::PrivetNotificationServiceFactory() 19 : BrowserContextKeyedServiceFactory( 20 "PrivetNotificationService", 21 BrowserContextDependencyManager::GetInstance()) { 22} 23 24PrivetNotificationServiceFactory::~PrivetNotificationServiceFactory() { 25} 26 27BrowserContextKeyedService* 28PrivetNotificationServiceFactory::BuildServiceInstanceFor( 29 content::BrowserContext* profile) const { 30 return new PrivetNotificationService(profile); 31} 32 33bool 34PrivetNotificationServiceFactory::ServiceIsCreatedWithBrowserContext() const { 35 return PrivetNotificationService::IsEnabled(); 36} 37 38bool PrivetNotificationServiceFactory::ServiceIsNULLWhileTesting() const { 39 return true; 40} 41 42} // namespace local_discovery 43