OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/global_error_service_factory.h" | 5 #include "chrome/browser/ui/global_error_service_factory.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile_dependency_manager.h" | 7 #include "chrome/browser/profiles/profile_dependency_manager.h" |
8 #include "chrome/browser/ui/global_error_service.h" | 8 #include "chrome/browser/ui/global_error_service.h" |
9 | 9 |
10 // static | 10 // static |
11 GlobalErrorService* GlobalErrorServiceFactory::GetForProfile(Profile* profile) { | 11 GlobalErrorService* GlobalErrorServiceFactory::GetForProfile(Profile* profile) { |
12 return static_cast<GlobalErrorService*>( | 12 return static_cast<GlobalErrorService*>( |
13 GetInstance()->GetServiceForProfile(profile, true)); | 13 GetInstance()->GetServiceForProfile(profile, true)); |
14 } | 14 } |
15 | 15 |
16 // static | 16 // static |
17 GlobalErrorServiceFactory* GlobalErrorServiceFactory::GetInstance() { | 17 GlobalErrorServiceFactory* GlobalErrorServiceFactory::GetInstance() { |
18 return Singleton<GlobalErrorServiceFactory>::get(); | 18 return Singleton<GlobalErrorServiceFactory>::get(); |
19 } | 19 } |
20 | 20 |
21 GlobalErrorServiceFactory::GlobalErrorServiceFactory() | 21 GlobalErrorServiceFactory::GlobalErrorServiceFactory() |
22 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { | 22 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
23 } | 23 } |
24 | 24 |
25 GlobalErrorServiceFactory::~GlobalErrorServiceFactory() { | 25 GlobalErrorServiceFactory::~GlobalErrorServiceFactory() { |
26 } | 26 } |
27 | 27 |
28 ProfileKeyedService* GlobalErrorServiceFactory::BuildServiceInstanceFor( | 28 ProfileKeyedService* GlobalErrorServiceFactory::BuildServiceInstanceFor( |
29 Profile* profile) const { | 29 Profile* profile) const { |
30 return new GlobalErrorService(); | 30 return new GlobalErrorService(profile); |
31 } | 31 } |
32 | 32 |
33 bool GlobalErrorServiceFactory::ServiceRedirectedInIncognito() { | 33 bool GlobalErrorServiceFactory::ServiceRedirectedInIncognito() { |
34 return true; | 34 return true; |
35 } | 35 } |
OLD | NEW |