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

Side by Side Diff: chrome/browser/permissions/chooser_context.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 2016 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/permissions/chooser_context.h"
6
7 #include "chrome/browser/bluetooth/bluetooth_permission_context.h"
8 #include "chrome/browser/bluetooth/bluetooth_permission_context_factory.h"
9 #include "chrome/browser/permissions/chooser_context_base.h"
10 #include "content/public/browser/permission_type.h"
11
12 using content::PermissionType;
13
14 // static
15 ChooserContextBase* ChooserContext::Get(Profile* profile,
16 PermissionType permission_type) {
17 // NOTE: the factories used in this method have to stay in sync with
18 // ::GetFactories() below.
19 switch (permission_type) {
20 case PermissionType::BLUETOOTH:
21 return BluetoothPermissionContextFactory::GetForProfile(profile);
22 default:
23 NOTREACHED() << "No ChooserContext associated with "
24 << static_cast<int>(permission_type);
25 break;
26 }
27
28 return nullptr;
29 }
30
31 // static
32 const std::list<KeyedServiceBaseFactory*>& ChooserContext::GetFactories() {
33 // NOTE: this list has to stay in sync with the factories used by ::Get().
34 CR_DEFINE_STATIC_LOCAL(std::list<KeyedServiceBaseFactory*>, factories, ());
35
36 if (factories.empty()) {
37 factories.push_back(BluetoothPermissionContextFactory::GetInstance());
38 }
39
40 return factories;
41 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/chooser_context.h ('k') | chrome/browser/permissions/chooser_permission_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698