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

Side by Side Diff: chrome/browser/favicon/large_icon_service_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add \n Created 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/favicon/large_icon_service_factory.h" 5 #include "chrome/browser/favicon/large_icon_service_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/favicon/favicon_service_factory.h" 8 #include "chrome/browser/favicon/favicon_service_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "components/favicon/core/favicon_service.h" 10 #include "components/favicon/core/favicon_service.h"
11 #include "components/favicon/core/large_icon_service.h" 11 #include "components/favicon/core/large_icon_service.h"
12 #include "components/keyed_service/content/browser_context_dependency_manager.h" 12 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 #include "content/public/browser/browser_context.h" 13 #include "content/public/browser/browser_context.h"
14 14
15 // static 15 // static
16 favicon::LargeIconService* LargeIconServiceFactory::GetForBrowserContext( 16 favicon::LargeIconService* LargeIconServiceFactory::GetForBrowserContext(
17 content::BrowserContext* context) { 17 content::BrowserContext* context) {
18 return static_cast<favicon::LargeIconService*>( 18 return static_cast<favicon::LargeIconService*>(
19 GetInstance()->GetServiceForBrowserContext(context, true)); 19 GetInstance()->GetServiceForBrowserContext(context, true));
20 } 20 }
21 21
22 // static 22 // static
23 LargeIconServiceFactory* LargeIconServiceFactory::GetInstance() { 23 LargeIconServiceFactory* LargeIconServiceFactory::GetInstance() {
24 return Singleton<LargeIconServiceFactory>::get(); 24 return base::Singleton<LargeIconServiceFactory>::get();
25 } 25 }
26 26
27 LargeIconServiceFactory::LargeIconServiceFactory() 27 LargeIconServiceFactory::LargeIconServiceFactory()
28 : BrowserContextKeyedServiceFactory( 28 : BrowserContextKeyedServiceFactory(
29 "LargeIconService", 29 "LargeIconService",
30 BrowserContextDependencyManager::GetInstance()) { 30 BrowserContextDependencyManager::GetInstance()) {
31 DependsOn(FaviconServiceFactory::GetInstance()); 31 DependsOn(FaviconServiceFactory::GetInstance());
32 } 32 }
33 33
34 LargeIconServiceFactory::~LargeIconServiceFactory() {} 34 LargeIconServiceFactory::~LargeIconServiceFactory() {}
35 35
36 KeyedService* LargeIconServiceFactory::BuildServiceInstanceFor( 36 KeyedService* LargeIconServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* context) const { 37 content::BrowserContext* context) const {
38 favicon::FaviconService* favicon_service = 38 favicon::FaviconService* favicon_service =
39 FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context), 39 FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context),
40 ServiceAccessType::EXPLICIT_ACCESS); 40 ServiceAccessType::EXPLICIT_ACCESS);
41 return new favicon::LargeIconService(favicon_service); 41 return new favicon::LargeIconService(favicon_service);
42 } 42 }
43 43
44 bool LargeIconServiceFactory::ServiceIsNULLWhileTesting() const { 44 bool LargeIconServiceFactory::ServiceIsNULLWhileTesting() const {
45 return true; 45 return true;
46 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698