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

Side by Side Diff: chrome/browser/notifications/extension_welcome_notification_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/notifications/extension_welcome_notification_factory.h" 5 #include "chrome/browser/notifications/extension_welcome_notification_factory.h"
6 6
7 #include "chrome/browser/notifications/extension_welcome_notification.h" 7 #include "chrome/browser/notifications/extension_welcome_notification.h"
8 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" 8 #include "chrome/browser/notifications/notifier_state_tracker_factory.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" 11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 13
14 // static 14 // static
15 ExtensionWelcomeNotification* 15 ExtensionWelcomeNotification*
16 ExtensionWelcomeNotificationFactory::GetForBrowserContext( 16 ExtensionWelcomeNotificationFactory::GetForBrowserContext(
17 content::BrowserContext* context) { 17 content::BrowserContext* context) {
18 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 18 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
19 return static_cast<ExtensionWelcomeNotification*>( 19 return static_cast<ExtensionWelcomeNotification*>(
20 GetInstance()->GetServiceForBrowserContext(context, true)); 20 GetInstance()->GetServiceForBrowserContext(context, true));
21 } 21 }
22 22
23 // static 23 // static
24 ExtensionWelcomeNotificationFactory* 24 ExtensionWelcomeNotificationFactory*
25 ExtensionWelcomeNotificationFactory::GetInstance() { 25 ExtensionWelcomeNotificationFactory::GetInstance() {
26 return Singleton<ExtensionWelcomeNotificationFactory>::get(); 26 return base::Singleton<ExtensionWelcomeNotificationFactory>::get();
27 } 27 }
28 28
29 ExtensionWelcomeNotificationFactory::ExtensionWelcomeNotificationFactory() 29 ExtensionWelcomeNotificationFactory::ExtensionWelcomeNotificationFactory()
30 : BrowserContextKeyedServiceFactory( 30 : BrowserContextKeyedServiceFactory(
31 "ExtensionWelcomeNotification", 31 "ExtensionWelcomeNotification",
32 BrowserContextDependencyManager::GetInstance()) { 32 BrowserContextDependencyManager::GetInstance()) {
33 DependsOn(NotifierStateTrackerFactory::GetInstance()); 33 DependsOn(NotifierStateTrackerFactory::GetInstance());
34 } 34 }
35 35
36 ExtensionWelcomeNotificationFactory::~ExtensionWelcomeNotificationFactory() {} 36 ExtensionWelcomeNotificationFactory::~ExtensionWelcomeNotificationFactory() {}
37 37
38 KeyedService* ExtensionWelcomeNotificationFactory::BuildServiceInstanceFor( 38 KeyedService* ExtensionWelcomeNotificationFactory::BuildServiceInstanceFor(
39 content::BrowserContext* context) const { 39 content::BrowserContext* context) const {
40 return ExtensionWelcomeNotification::Create(static_cast<Profile*>(context)); 40 return ExtensionWelcomeNotification::Create(static_cast<Profile*>(context));
41 } 41 }
42 42
43 content::BrowserContext* 43 content::BrowserContext*
44 ExtensionWelcomeNotificationFactory::GetBrowserContextToUse( 44 ExtensionWelcomeNotificationFactory::GetBrowserContextToUse(
45 content::BrowserContext* context) const { 45 content::BrowserContext* context) const {
46 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 46 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
47 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698