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/tabs/pinned_tab_service_factory.h" | 5 #include "chrome/browser/tabs/pinned_tab_service_factory.h" |
6 | 6 |
7 #include "chrome/browser/tabs/pinned_tab_service.h" | 7 #include "chrome/browser/tabs/pinned_tab_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/profiles/profile_dependency_manager.h" | 9 #include "chrome/browser/profiles/profile_dependency_manager.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 base::LazyInstance<PinnedTabServiceFactory> g_pinned_tab_service_factory( | 12 base::LazyInstance<PinnedTabServiceFactory> g_pinned_tab_service_factory = |
13 base::LINKER_INITIALIZED); | 13 LAZY_INSTANCE_INITIALIZER; |
14 } | 14 } |
15 | 15 |
16 // static | 16 // static |
17 void PinnedTabServiceFactory::InitForProfile(Profile* profile) { | 17 void PinnedTabServiceFactory::InitForProfile(Profile* profile) { |
18 g_pinned_tab_service_factory.Get().GetServiceForProfile(profile, true); | 18 g_pinned_tab_service_factory.Get().GetServiceForProfile(profile, true); |
19 } | 19 } |
20 | 20 |
21 PinnedTabServiceFactory::PinnedTabServiceFactory() | 21 PinnedTabServiceFactory::PinnedTabServiceFactory() |
22 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { | 22 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
23 } | 23 } |
24 | 24 |
25 PinnedTabServiceFactory::~PinnedTabServiceFactory() { | 25 PinnedTabServiceFactory::~PinnedTabServiceFactory() { |
26 } | 26 } |
27 | 27 |
28 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( | 28 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( |
29 Profile* profile) const { | 29 Profile* profile) const { |
30 return new PinnedTabService(profile); | 30 return new PinnedTabService(profile); |
31 } | 31 } |
OLD | NEW |