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/profiles/profile.h" | |
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
9 | |
10 // static | |
11 scoped_refptr<JumpList> JumpListFactory::GetForProfile(Profile* profile) { | |
12 return static_cast<JumpList*>( | |
13 GetInstance()->GetServiceForBrowserContext(profile, true).get()); | |
14 } | |
15 | |
16 // static | |
17 JumpListFactory* JumpListFactory::GetInstance() { | |
18 return base::Singleton<JumpListFactory>::get(); | |
19 } | |
20 | |
21 JumpListFactory::JumpListFactory() | |
22 : RefcountedBrowserContextKeyedServiceFactory( | |
23 "JumpList", | |
24 BrowserContextDependencyManager::GetInstance()) {} | |
gab
2016/09/09 19:02:30
Dependencies are declared here in constructor thro
Ilya Kulshin
2016/09/13 00:01:00
Done.
| |
25 | |
26 JumpListFactory::~JumpListFactory() = default; | |
27 | |
28 scoped_refptr<RefcountedKeyedService> JumpListFactory::BuildServiceInstanceFor( | |
29 content::BrowserContext* context) const { | |
30 return new JumpList(static_cast<Profile*>(context)); | |
gab
2016/09/09 19:02:30
Profile::FromBrowserContext() instead of static_ca
Ilya Kulshin
2016/09/13 00:01:00
Done.
| |
31 } | |
OLD | NEW |