| 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 // 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)); | 15 GetInstance()->GetServiceForProfile(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(ProfileDependencyManager::GetInstance()) { | 23 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
| 24 } | 24 } |
| 25 | 25 |
| 26 PinnedTabServiceFactory::~PinnedTabServiceFactory() { | 26 PinnedTabServiceFactory::~PinnedTabServiceFactory() { |
| 27 } | 27 } |
| 28 | 28 |
| 29 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( | 29 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( |
| 30 Profile* profile) const { | 30 Profile* profile) const { |
| 31 return new PinnedTabService(profile); | 31 return new PinnedTabService(profile); |
| 32 } | 32 } |
| OLD | NEW |