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 "chrome/browser/win/jumplist.h" |
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
12 | 13 |
13 // static | 14 // static |
14 scoped_refptr<JumpList> JumpListFactory::GetForProfile(Profile* profile) { | 15 JumpList* JumpListFactory::GetForProfile(Profile* profile) { |
15 return static_cast<JumpList*>( | 16 return static_cast<JumpList*>( |
16 GetInstance()->GetServiceForBrowserContext(profile, true).get()); | 17 GetInstance()->GetServiceForBrowserContext(profile, true)); |
17 } | 18 } |
18 | 19 |
19 // static | 20 // static |
20 JumpListFactory* JumpListFactory::GetInstance() { | 21 JumpListFactory* JumpListFactory::GetInstance() { |
21 return base::Singleton<JumpListFactory>::get(); | 22 return base::Singleton<JumpListFactory>::get(); |
22 } | 23 } |
23 | 24 |
24 JumpListFactory::JumpListFactory() | 25 JumpListFactory::JumpListFactory() |
25 : RefcountedBrowserContextKeyedServiceFactory( | 26 : BrowserContextKeyedServiceFactory( |
26 "JumpList", | 27 "JumpList", |
27 BrowserContextDependencyManager::GetInstance()) { | 28 BrowserContextDependencyManager::GetInstance()) { |
28 DependsOn(TabRestoreServiceFactory::GetInstance()); | 29 DependsOn(TabRestoreServiceFactory::GetInstance()); |
29 DependsOn(TopSitesFactory::GetInstance()); | 30 DependsOn(TopSitesFactory::GetInstance()); |
30 DependsOn(FaviconServiceFactory::GetInstance()); | 31 DependsOn(FaviconServiceFactory::GetInstance()); |
31 } | 32 } |
32 | 33 |
33 JumpListFactory::~JumpListFactory() = default; | 34 JumpListFactory::~JumpListFactory() = default; |
34 | 35 |
35 scoped_refptr<RefcountedKeyedService> JumpListFactory::BuildServiceInstanceFor( | 36 KeyedService* JumpListFactory::BuildServiceInstanceFor( |
36 content::BrowserContext* context) const { | 37 content::BrowserContext* context) const { |
37 return new JumpList(Profile::FromBrowserContext(context)); | 38 return new JumpList(Profile::FromBrowserContext(context)); |
38 } | 39 } |
OLD | NEW |