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/ui/tabs/pinned_tab_service_factory.h" | 5 #include "chrome/browser/ui/tabs/pinned_tab_service_factory.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/tabs/pinned_tab_service.h" | 8 #include "chrome/browser/ui/tabs/pinned_tab_service.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 PinnedTabService* PinnedTabServiceFactory::GetForProfile( | 12 PinnedTabService* PinnedTabServiceFactory::GetForProfile( |
13 Profile* profile) { | 13 Profile* profile) { |
14 return static_cast<PinnedTabService*>( | 14 return static_cast<PinnedTabService*>( |
15 GetInstance()->GetServiceForProfile(profile, true)); | 15 GetInstance()->GetServiceForBrowserContext(profile, true)); |
16 } | 16 } |
17 | 17 |
18 PinnedTabServiceFactory* PinnedTabServiceFactory::GetInstance() { | 18 PinnedTabServiceFactory* PinnedTabServiceFactory::GetInstance() { |
19 return Singleton<PinnedTabServiceFactory>::get(); | 19 return Singleton<PinnedTabServiceFactory>::get(); |
20 } | 20 } |
21 | 21 |
22 PinnedTabServiceFactory::PinnedTabServiceFactory() | 22 PinnedTabServiceFactory::PinnedTabServiceFactory() |
23 : ProfileKeyedServiceFactory("PinnedTabService", | 23 : BrowserContextKeyedServiceFactory( |
24 ProfileDependencyManager::GetInstance()) { | 24 "PinnedTabService", |
| 25 BrowserContextDependencyManager::GetInstance()) { |
25 } | 26 } |
26 | 27 |
27 PinnedTabServiceFactory::~PinnedTabServiceFactory() { | 28 PinnedTabServiceFactory::~PinnedTabServiceFactory() { |
28 } | 29 } |
29 | 30 |
30 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( | 31 BrowserContextKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( |
31 content::BrowserContext* profile) const { | 32 content::BrowserContext* profile) const { |
32 return new PinnedTabService(static_cast<Profile*>(profile)); | 33 return new PinnedTabService(static_cast<Profile*>(profile)); |
33 } | 34 } |
34 | 35 |
35 bool PinnedTabServiceFactory::ServiceIsCreatedWithProfile() const { | 36 bool PinnedTabServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
36 return true; | 37 return true; |
37 } | 38 } |
38 | 39 |
39 bool PinnedTabServiceFactory::ServiceIsNULLWhileTesting() const { | 40 bool PinnedTabServiceFactory::ServiceIsNULLWhileTesting() const { |
40 return true; | 41 return true; |
41 } | 42 } |
OLD | NEW |