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

Side by Side Diff: chrome/browser/extensions/api/passwords_private/passwords_private_delegate_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 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/extensions/api/passwords_private/passwords_private_dele gate_factory.h" 5 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele gate_factory.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele gate_impl.h" 8 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele gate_impl.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 #include "extensions/browser/extension_system_provider.h" 11 #include "extensions/browser/extension_system_provider.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 using content::BrowserContext; 15 using content::BrowserContext;
16 16
17 // static 17 // static
18 PasswordsPrivateDelegate* PasswordsPrivateDelegateFactory::GetForBrowserContext( 18 PasswordsPrivateDelegate* PasswordsPrivateDelegateFactory::GetForBrowserContext(
19 BrowserContext* browser_context, 19 BrowserContext* browser_context,
20 bool create) { 20 bool create) {
21 return static_cast<PasswordsPrivateDelegate*>( 21 return static_cast<PasswordsPrivateDelegate*>(
22 GetInstance()->GetServiceForBrowserContext(browser_context, create)); 22 GetInstance()->GetServiceForBrowserContext(browser_context, create));
23 } 23 }
24 24
25 // static 25 // static
26 PasswordsPrivateDelegateFactory* 26 PasswordsPrivateDelegateFactory*
27 PasswordsPrivateDelegateFactory::GetInstance() { 27 PasswordsPrivateDelegateFactory::GetInstance() {
28 return Singleton<PasswordsPrivateDelegateFactory>::get(); 28 return base::Singleton<PasswordsPrivateDelegateFactory>::get();
29 } 29 }
30 30
31 PasswordsPrivateDelegateFactory::PasswordsPrivateDelegateFactory() 31 PasswordsPrivateDelegateFactory::PasswordsPrivateDelegateFactory()
32 : BrowserContextKeyedServiceFactory( 32 : BrowserContextKeyedServiceFactory(
33 "PasswordsPrivateDelegate", 33 "PasswordsPrivateDelegate",
34 BrowserContextDependencyManager::GetInstance()) { 34 BrowserContextDependencyManager::GetInstance()) {
35 } 35 }
36 36
37 PasswordsPrivateDelegateFactory::~PasswordsPrivateDelegateFactory() { 37 PasswordsPrivateDelegateFactory::~PasswordsPrivateDelegateFactory() {
38 } 38 }
39 39
40 KeyedService* PasswordsPrivateDelegateFactory::BuildServiceInstanceFor( 40 KeyedService* PasswordsPrivateDelegateFactory::BuildServiceInstanceFor(
41 content::BrowserContext* profile) const { 41 content::BrowserContext* profile) const {
42 return new PasswordsPrivateDelegateImpl(static_cast<Profile*>(profile)); 42 return new PasswordsPrivateDelegateImpl(static_cast<Profile*>(profile));
43 } 43 }
44 44
45 bool PasswordsPrivateDelegateFactory:: 45 bool PasswordsPrivateDelegateFactory::
46 ServiceIsCreatedWithBrowserContext() const { 46 ServiceIsCreatedWithBrowserContext() const {
47 return false; 47 return false;
48 } 48 }
49 49
50 bool PasswordsPrivateDelegateFactory::ServiceIsNULLWhileTesting() const { 50 bool PasswordsPrivateDelegateFactory::ServiceIsNULLWhileTesting() const {
51 return false; 51 return false;
52 } 52 }
53 53
54 } // namespace extensions 54 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698