| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/consumer_management_notifier_factory.h" | 5 #include "chrome/browser/chromeos/policy/consumer_management_notifier_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/browser_process_platform_part.h" | 8 #include "chrome/browser/browser_process_platform_part.h" |
| 9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 10 #include "chrome/browser/chromeos/policy/consumer_management_notifier.h" | 10 #include "chrome/browser/chromeos/policy/consumer_management_notifier.h" |
| 11 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 11 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 13 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 14 #include "components/user_manager/user_manager.h" | 14 #include "components/user_manager/user_manager.h" |
| 15 | 15 |
| 16 namespace policy { | 16 namespace policy { |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 ConsumerManagementNotifier* | 19 ConsumerManagementNotifier* |
| 20 ConsumerManagementNotifierFactory::GetForBrowserContext( | 20 ConsumerManagementNotifierFactory::GetForBrowserContext( |
| 21 content::BrowserContext* context) { | 21 content::BrowserContext* context) { |
| 22 return static_cast<ConsumerManagementNotifier*>( | 22 return static_cast<ConsumerManagementNotifier*>( |
| 23 GetInstance()->GetServiceForBrowserContext(context, true)); | 23 GetInstance()->GetServiceForBrowserContext(context, true)); |
| 24 } | 24 } |
| 25 | 25 |
| 26 // static | 26 // static |
| 27 ConsumerManagementNotifierFactory* | 27 ConsumerManagementNotifierFactory* |
| 28 ConsumerManagementNotifierFactory::GetInstance() { | 28 ConsumerManagementNotifierFactory::GetInstance() { |
| 29 return Singleton<ConsumerManagementNotifierFactory>::get(); | 29 return base::Singleton<ConsumerManagementNotifierFactory>::get(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 ConsumerManagementNotifierFactory::ConsumerManagementNotifierFactory() | 32 ConsumerManagementNotifierFactory::ConsumerManagementNotifierFactory() |
| 33 : BrowserContextKeyedServiceFactory( | 33 : BrowserContextKeyedServiceFactory( |
| 34 "ConsumerManagementNotifier", | 34 "ConsumerManagementNotifier", |
| 35 BrowserContextDependencyManager::GetInstance()) { | 35 BrowserContextDependencyManager::GetInstance()) { |
| 36 } | 36 } |
| 37 | 37 |
| 38 ConsumerManagementNotifierFactory::~ConsumerManagementNotifierFactory() { | 38 ConsumerManagementNotifierFactory::~ConsumerManagementNotifierFactory() { |
| 39 } | 39 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 58 | 58 |
| 59 return new ConsumerManagementNotifier(profile, service); | 59 return new ConsumerManagementNotifier(profile, service); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool ConsumerManagementNotifierFactory::ServiceIsCreatedWithBrowserContext() | 62 bool ConsumerManagementNotifierFactory::ServiceIsCreatedWithBrowserContext() |
| 63 const { | 63 const { |
| 64 return true; | 64 return true; |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace policy | 67 } // namespace policy |
| OLD | NEW |