OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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/accessibility/accessibility_notifier_factory.h" |
| 6 |
| 7 #include "chrome/browser/accessibility/accessibility_notifier.h" |
| 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 10 #include "content/public/browser/browser_context.h" |
| 11 |
| 12 // static |
| 13 AccessibilityNotifierFactory* AccessibilityNotifierFactory::GetInstance() { |
| 14 return Singleton<AccessibilityNotifierFactory>::get(); |
| 15 } |
| 16 |
| 17 // static |
| 18 AccessibilityNotifier* AccessibilityNotifierFactory::GetForProfile( |
| 19 Profile* profile) { |
| 20 return reinterpret_cast<AccessibilityNotifier*>( |
| 21 GetInstance()->GetServiceForBrowserContext(profile, false)); |
| 22 } |
| 23 |
| 24 KeyedService* AccessibilityNotifierFactory::BuildServiceInstanceFor( |
| 25 content::BrowserContext* context) const { |
| 26 return new AccessibilityNotifier(static_cast<Profile*>(context)); |
| 27 } |
| 28 |
| 29 AccessibilityNotifierFactory::AccessibilityNotifierFactory() |
| 30 : BrowserContextKeyedServiceFactory( |
| 31 "AccessibilityNotifier", |
| 32 BrowserContextDependencyManager::GetInstance()) { |
| 33 } |
| 34 |
| 35 AccessibilityNotifierFactory::~AccessibilityNotifierFactory() { |
| 36 } |
| 37 |
| 38 bool AccessibilityNotifierFactory::ServiceIsCreatedWithBrowserContext() const { |
| 39 return true; |
| 40 } |
OLD | NEW |