Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: chrome/browser/win/jumplist_factory.cc

Issue 2323603002: Convert JumpList to a KeyedService. (Closed)
Patch Set: Clang fixes Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/win/jumplist_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « chrome/browser/win/jumplist_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698