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

Side by Side Diff: chrome/browser/apps/shortcut_manager_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: ToT 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/apps/shortcut_manager_factory.h" 5 #include "chrome/browser/apps/shortcut_manager_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/apps/shortcut_manager.h" 8 #include "chrome/browser/apps/shortcut_manager.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" 10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 11
12 // static 12 // static
13 AppShortcutManager* AppShortcutManagerFactory::GetForProfile(Profile* profile) { 13 AppShortcutManager* AppShortcutManagerFactory::GetForProfile(Profile* profile) {
14 return static_cast<AppShortcutManager*>( 14 return static_cast<AppShortcutManager*>(
15 GetInstance()->GetServiceForBrowserContext(profile, 15 GetInstance()->GetServiceForBrowserContext(profile,
16 false /* don't create */)); 16 false /* don't create */));
17 } 17 }
18 18
19 AppShortcutManagerFactory* AppShortcutManagerFactory::GetInstance() { 19 AppShortcutManagerFactory* AppShortcutManagerFactory::GetInstance() {
20 return Singleton<AppShortcutManagerFactory>::get(); 20 return base::Singleton<AppShortcutManagerFactory>::get();
21 } 21 }
22 22
23 AppShortcutManagerFactory::AppShortcutManagerFactory() 23 AppShortcutManagerFactory::AppShortcutManagerFactory()
24 : BrowserContextKeyedServiceFactory( 24 : BrowserContextKeyedServiceFactory(
25 "AppShortcutManager", 25 "AppShortcutManager",
26 BrowserContextDependencyManager::GetInstance()) { 26 BrowserContextDependencyManager::GetInstance()) {
27 } 27 }
28 28
29 AppShortcutManagerFactory::~AppShortcutManagerFactory() { 29 AppShortcutManagerFactory::~AppShortcutManagerFactory() {
30 } 30 }
31 31
32 KeyedService* AppShortcutManagerFactory::BuildServiceInstanceFor( 32 KeyedService* AppShortcutManagerFactory::BuildServiceInstanceFor(
33 content::BrowserContext* profile) const { 33 content::BrowserContext* profile) const {
34 return new AppShortcutManager(static_cast<Profile*>(profile)); 34 return new AppShortcutManager(static_cast<Profile*>(profile));
35 } 35 }
36 36
37 bool AppShortcutManagerFactory::ServiceIsCreatedWithBrowserContext() const { 37 bool AppShortcutManagerFactory::ServiceIsCreatedWithBrowserContext() const {
38 return true; 38 return true;
39 } 39 }
40 40
41 bool AppShortcutManagerFactory::ServiceIsNULLWhileTesting() const { 41 bool AppShortcutManagerFactory::ServiceIsNULLWhileTesting() const {
42 return true; 42 return true;
43 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/shortcut_manager_factory.h ('k') | chrome/browser/autocomplete/autocomplete_classifier_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698