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

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

Issue 2937993002: Revert of Fix stability and data racing issues, coalesce more updates for JumpList (Closed)
Patch Set: Created 3 years, 6 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
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"
12 #include "components/keyed_service/content/browser_context_dependency_manager.h" 11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 12
14 // static 13 // static
15 JumpList* JumpListFactory::GetForProfile(Profile* profile) { 14 scoped_refptr<JumpList> JumpListFactory::GetForProfile(Profile* profile) {
16 return static_cast<JumpList*>( 15 return static_cast<JumpList*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true)); 16 GetInstance()->GetServiceForBrowserContext(profile, true).get());
18 } 17 }
19 18
20 // static 19 // static
21 JumpListFactory* JumpListFactory::GetInstance() { 20 JumpListFactory* JumpListFactory::GetInstance() {
22 return base::Singleton<JumpListFactory>::get(); 21 return base::Singleton<JumpListFactory>::get();
23 } 22 }
24 23
25 JumpListFactory::JumpListFactory() 24 JumpListFactory::JumpListFactory()
26 : BrowserContextKeyedServiceFactory( 25 : RefcountedBrowserContextKeyedServiceFactory(
27 "JumpList", 26 "JumpList",
28 BrowserContextDependencyManager::GetInstance()) { 27 BrowserContextDependencyManager::GetInstance()) {
29 DependsOn(TabRestoreServiceFactory::GetInstance()); 28 DependsOn(TabRestoreServiceFactory::GetInstance());
30 DependsOn(TopSitesFactory::GetInstance()); 29 DependsOn(TopSitesFactory::GetInstance());
31 DependsOn(FaviconServiceFactory::GetInstance()); 30 DependsOn(FaviconServiceFactory::GetInstance());
32 } 31 }
33 32
34 JumpListFactory::~JumpListFactory() = default; 33 JumpListFactory::~JumpListFactory() = default;
35 34
36 KeyedService* JumpListFactory::BuildServiceInstanceFor( 35 scoped_refptr<RefcountedKeyedService> JumpListFactory::BuildServiceInstanceFor(
37 content::BrowserContext* context) const { 36 content::BrowserContext* context) const {
38 return new JumpList(Profile::FromBrowserContext(context)); 37 return new JumpList(Profile::FromBrowserContext(context));
39 } 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