OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/win/jumplist_factory.h" |
| 6 |
| 7 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 8 #include "chrome/browser/history/top_sites_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 12 |
| 13 // static |
| 14 scoped_refptr<JumpList> JumpListFactory::GetForProfile(Profile* profile) { |
| 15 return static_cast<JumpList*>( |
| 16 GetInstance()->GetServiceForBrowserContext(profile, true).get()); |
| 17 } |
| 18 |
| 19 // static |
| 20 JumpListFactory* JumpListFactory::GetInstance() { |
| 21 return base::Singleton<JumpListFactory>::get(); |
| 22 } |
| 23 |
| 24 JumpListFactory::JumpListFactory() |
| 25 : RefcountedBrowserContextKeyedServiceFactory( |
| 26 "JumpList", |
| 27 BrowserContextDependencyManager::GetInstance()) { |
| 28 DependsOn(TabRestoreServiceFactory::GetInstance()); |
| 29 DependsOn(TopSitesFactory::GetInstance()); |
| 30 DependsOn(FaviconServiceFactory::GetInstance()); |
| 31 } |
| 32 |
| 33 JumpListFactory::~JumpListFactory() = default; |
| 34 |
| 35 scoped_refptr<RefcountedKeyedService> JumpListFactory::BuildServiceInstanceFor( |
| 36 content::BrowserContext* context) const { |
| 37 return new JumpList(Profile::FromBrowserContext(context)); |
| 38 } |
OLD | NEW |