OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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/win/jumplist_factory.h" | 5 #include "chrome/browser/win/jumplist_factory.h" |
6 | 6 |
7 #include "chrome/browser/favicon/favicon_service_factory.h" | 7 #include "chrome/browser/favicon/favicon_service_factory.h" |
8 #include "chrome/browser/history/top_sites_factory.h" | 8 #include "chrome/browser/history/top_sites_factory.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 10 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
12 | 12 |
13 // static | 13 // static |
14 scoped_refptr<JumpList> JumpListFactory::GetForProfile(Profile* profile) { | 14 JumpList* JumpListFactory::GetForProfile(Profile* profile) { |
15 return static_cast<JumpList*>( | 15 return static_cast<JumpList*>( |
16 GetInstance()->GetServiceForBrowserContext(profile, true).get()); | 16 GetInstance()->GetServiceForBrowserContext(profile, true)); |
17 } | 17 } |
18 | 18 |
19 // static | 19 // static |
20 JumpListFactory* JumpListFactory::GetInstance() { | 20 JumpListFactory* JumpListFactory::GetInstance() { |
21 return base::Singleton<JumpListFactory>::get(); | 21 return base::Singleton<JumpListFactory>::get(); |
22 } | 22 } |
23 | 23 |
24 JumpListFactory::JumpListFactory() | 24 JumpListFactory::JumpListFactory() |
25 : RefcountedBrowserContextKeyedServiceFactory( | 25 : BrowserContextKeyedServiceFactory( |
26 "JumpList", | 26 "JumpList", |
27 BrowserContextDependencyManager::GetInstance()) { | 27 BrowserContextDependencyManager::GetInstance()) { |
28 DependsOn(TabRestoreServiceFactory::GetInstance()); | 28 DependsOn(TabRestoreServiceFactory::GetInstance()); |
29 DependsOn(TopSitesFactory::GetInstance()); | 29 DependsOn(TopSitesFactory::GetInstance()); |
30 DependsOn(FaviconServiceFactory::GetInstance()); | 30 DependsOn(FaviconServiceFactory::GetInstance()); |
31 } | 31 } |
32 | 32 |
33 JumpListFactory::~JumpListFactory() = default; | 33 JumpListFactory::~JumpListFactory() = default; |
34 | 34 |
35 scoped_refptr<RefcountedKeyedService> JumpListFactory::BuildServiceInstanceFor( | 35 KeyedService* JumpListFactory::BuildServiceInstanceFor( |
36 content::BrowserContext* context) const { | 36 content::BrowserContext* context) const { |
37 return new JumpList(Profile::FromBrowserContext(context)); | 37 return new JumpList(Profile::FromBrowserContext(context)); |
38 } | 38 } |
OLD | NEW |