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

Side by Side Diff: chrome/browser/bluetooth/bluetooth_permission_context_factory.cc

Issue 1560263002: Store Bluetooth permissions in website settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added code to check session->chooser_permission_manager Created 4 years, 11 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/bluetooth/bluetooth_permission_context_factory.h"
6
7 #include "chrome/browser/bluetooth/bluetooth_permission_context.h"
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12
13 BluetoothPermissionContextFactory::BluetoothPermissionContextFactory()
14 : BrowserContextKeyedServiceFactory(
15 "BluetoothPermissionContext",
16 BrowserContextDependencyManager::GetInstance()) {
17 DependsOn(HostContentSettingsMapFactory::GetInstance());
18 }
19
20 BluetoothPermissionContextFactory::~BluetoothPermissionContextFactory() {}
21
22 KeyedService* BluetoothPermissionContextFactory::BuildServiceInstanceFor(
23 content::BrowserContext* context) const {
24 return new BluetoothPermissionContext(Profile::FromBrowserContext(context));
25 }
26
27 // static
28 BluetoothPermissionContextFactory*
29 BluetoothPermissionContextFactory::GetInstance() {
30 return base::Singleton<BluetoothPermissionContextFactory>::get();
31 }
32
33 // static
34 BluetoothPermissionContext* BluetoothPermissionContextFactory::GetForProfile(
35 Profile* profile) {
36 return static_cast<BluetoothPermissionContext*>(
37 GetInstance()->GetServiceForBrowserContext(profile, true));
38 }
39
40 content::BrowserContext*
41 BluetoothPermissionContextFactory::GetBrowserContextToUse(
42 content::BrowserContext* context) const {
43 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
44 }
OLDNEW
« no previous file with comments | « chrome/browser/bluetooth/bluetooth_permission_context_factory.h ('k') | chrome/browser/permissions/chooser_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698