| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
| 6 | 6 |
| 7 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 7 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 9 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 10 | 10 |
| 11 // static | 11 // static |
| 12 CloudPrintProxyService* CloudPrintProxyServiceFactory::GetForProfile( | 12 CloudPrintProxyService* CloudPrintProxyServiceFactory::GetForProfile( |
| 13 Profile* profile) { | 13 Profile* profile) { |
| 14 return static_cast<CloudPrintProxyService*>( | 14 return static_cast<CloudPrintProxyService*>( |
| 15 GetInstance()->GetServiceForProfile(profile, true)); | 15 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 16 } | 16 } |
| 17 | 17 |
| 18 CloudPrintProxyServiceFactory* CloudPrintProxyServiceFactory::GetInstance() { | 18 CloudPrintProxyServiceFactory* CloudPrintProxyServiceFactory::GetInstance() { |
| 19 return Singleton<CloudPrintProxyServiceFactory>::get(); | 19 return Singleton<CloudPrintProxyServiceFactory>::get(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 CloudPrintProxyServiceFactory::CloudPrintProxyServiceFactory() | 22 CloudPrintProxyServiceFactory::CloudPrintProxyServiceFactory() |
| 23 : ProfileKeyedServiceFactory("CloudPrintProxyService", | 23 : BrowserContextKeyedServiceFactory("CloudPrintProxyService", |
| 24 ProfileDependencyManager::GetInstance()) { | 24 BrowserContextDependencyManager::GetInstance())
{ |
| 25 } | 25 } |
| 26 | 26 |
| 27 CloudPrintProxyServiceFactory::~CloudPrintProxyServiceFactory() { | 27 CloudPrintProxyServiceFactory::~CloudPrintProxyServiceFactory() { |
| 28 } | 28 } |
| 29 | 29 |
| 30 ProfileKeyedService* CloudPrintProxyServiceFactory::BuildServiceInstanceFor( | 30 BrowserContextKeyedService* CloudPrintProxyServiceFactory::BuildServiceInstanceF
or( |
| 31 content::BrowserContext* profile) const { | 31 content::BrowserContext* profile) const { |
| 32 CloudPrintProxyService* service = | 32 CloudPrintProxyService* service = |
| 33 new CloudPrintProxyService(static_cast<Profile*>(profile)); | 33 new CloudPrintProxyService(static_cast<Profile*>(profile)); |
| 34 service->Initialize(); | 34 service->Initialize(); |
| 35 | 35 |
| 36 return service; | 36 return service; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool CloudPrintProxyServiceFactory::ServiceIsNULLWhileTesting() const { | 39 bool CloudPrintProxyServiceFactory::ServiceIsNULLWhileTesting() const { |
| 40 return true; | 40 return true; |
| 41 } | 41 } |
| OLD | NEW |