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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bluetooth/bluetooth_api_factory.h" 5 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h"
6 6
7 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" 7 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
8 #include "chrome/browser/extensions/extension_system_factory.h" 8 #include "chrome/browser/extensions/extension_system_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/browser_context_keyed_service/browser_context_dependency_ma nager.h" 11 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 // static 15 // static
16 BluetoothAPI* BluetoothAPIFactory::GetForProfile(Profile* profile) { 16 BluetoothAPI* BluetoothAPIFactory::GetForProfile(Profile* profile) {
17 return static_cast<BluetoothAPI*>( 17 return static_cast<BluetoothAPI*>(
18 GetInstance()->GetServiceForProfile(profile, true)); 18 GetInstance()->GetServiceForBrowserContext(profile, true));
19 } 19 }
20 20
21 // static 21 // static
22 BluetoothAPIFactory* BluetoothAPIFactory::GetInstance() { 22 BluetoothAPIFactory* BluetoothAPIFactory::GetInstance() {
23 return Singleton<BluetoothAPIFactory>::get(); 23 return Singleton<BluetoothAPIFactory>::get();
24 } 24 }
25 25
26 BluetoothAPIFactory::BluetoothAPIFactory() 26 BluetoothAPIFactory::BluetoothAPIFactory()
27 : ProfileKeyedServiceFactory("BluetoothAPI", 27 : BrowserContextKeyedServiceFactory("BluetoothAPI",
28 ProfileDependencyManager::GetInstance()) { 28 BrowserContextDependencyManager::GetInstance()) {
29 DependsOn(ExtensionSystemFactory::GetInstance()); 29 DependsOn(ExtensionSystemFactory::GetInstance());
30 } 30 }
31 31
32 BluetoothAPIFactory::~BluetoothAPIFactory() { 32 BluetoothAPIFactory::~BluetoothAPIFactory() {
33 } 33 }
34 34
35 ProfileKeyedService* BluetoothAPIFactory::BuildServiceInstanceFor( 35 BrowserContextKeyedService* BluetoothAPIFactory::BuildServiceInstanceFor(
36 content::BrowserContext* profile) const { 36 content::BrowserContext* profile) const {
37 return new BluetoothAPI(static_cast<Profile*>(profile)); 37 return new BluetoothAPI(static_cast<Profile*>(profile));
38 } 38 }
39 39
40 content::BrowserContext* BluetoothAPIFactory::GetBrowserContextToUse( 40 content::BrowserContext* BluetoothAPIFactory::GetBrowserContextToUse(
41 content::BrowserContext* context) const { 41 content::BrowserContext* context) const {
42 return chrome::GetBrowserContextRedirectedInIncognito(context); 42 return chrome::GetBrowserContextRedirectedInIncognito(context);
43 } 43 }
44 44
45 bool BluetoothAPIFactory::ServiceIsCreatedWithProfile() const { 45 bool BluetoothAPIFactory::ServiceIsCreatedWithBrowserContext() const {
46 return true; 46 return true;
47 } 47 }
48 48
49 bool BluetoothAPIFactory::ServiceIsNULLWhileTesting() const { 49 bool BluetoothAPIFactory::ServiceIsNULLWhileTesting() const {
50 return true; 50 return true;
51 } 51 }
52 52
53 } // namespace extensions 53 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698