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

Side by Side Diff: chrome/browser/permissions/permission_util.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
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/permissions/permission_util.h" 5 #include "chrome/browser/permissions/permission_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/browser/permission_type.h" 8 #include "content/public/browser/permission_type.h"
9 9
10 using content::PermissionType; 10 using content::PermissionType;
(...skipping 15 matching lines...) Expand all
26 case content::PermissionType::DURABLE_STORAGE: 26 case content::PermissionType::DURABLE_STORAGE:
27 return "DurableStorage"; 27 return "DurableStorage";
28 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER: 28 case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
29 return "ProtectedMediaIdentifier"; 29 return "ProtectedMediaIdentifier";
30 case content::PermissionType::AUDIO_CAPTURE: 30 case content::PermissionType::AUDIO_CAPTURE:
31 return "AudioCapture"; 31 return "AudioCapture";
32 case content::PermissionType::VIDEO_CAPTURE: 32 case content::PermissionType::VIDEO_CAPTURE:
33 return "VideoCapture"; 33 return "VideoCapture";
34 case content::PermissionType::MIDI: 34 case content::PermissionType::MIDI:
35 return "Midi"; 35 return "Midi";
36 case content::PermissionType::BLUETOOTH:
37 return "Bluetooth";
36 case content::PermissionType::NUM: 38 case content::PermissionType::NUM:
37 break; 39 break;
38 } 40 }
39 NOTREACHED(); 41 NOTREACHED();
40 return std::string(); 42 return std::string();
41 } 43 }
42 44
43 bool PermissionUtil::GetPermissionType(ContentSettingsType type, 45 bool PermissionUtil::GetPermissionType(ContentSettingsType type,
44 PermissionType* out) { 46 PermissionType* out) {
45 if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { 47 if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION) {
46 *out = PermissionType::GEOLOCATION; 48 *out = PermissionType::GEOLOCATION;
47 } else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) { 49 } else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
48 *out = PermissionType::NOTIFICATIONS; 50 *out = PermissionType::NOTIFICATIONS;
49 } else if (type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { 51 } else if (type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) {
50 *out = PermissionType::MIDI_SYSEX; 52 *out = PermissionType::MIDI_SYSEX;
51 } else if (type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) { 53 } else if (type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) {
52 *out = PermissionType::PUSH_MESSAGING; 54 *out = PermissionType::PUSH_MESSAGING;
53 } else if (type == CONTENT_SETTINGS_TYPE_DURABLE_STORAGE) { 55 } else if (type == CONTENT_SETTINGS_TYPE_DURABLE_STORAGE) {
54 *out = PermissionType::DURABLE_STORAGE; 56 *out = PermissionType::DURABLE_STORAGE;
55 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { 57 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
56 *out = PermissionType::VIDEO_CAPTURE; 58 *out = PermissionType::VIDEO_CAPTURE;
57 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) { 59 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) {
58 *out = PermissionType::AUDIO_CAPTURE; 60 *out = PermissionType::AUDIO_CAPTURE;
59 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) 61 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
60 } else if (type == CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) { 62 } else if (type == CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) {
61 *out = PermissionType::PROTECTED_MEDIA_IDENTIFIER; 63 *out = PermissionType::PROTECTED_MEDIA_IDENTIFIER;
62 #endif 64 #endif
65 } else if (type == CONTENT_SETTINGS_TYPE_BLUETOOTH_CHOOSER_DATA) {
66 *out = PermissionType::BLUETOOTH;
63 } else { 67 } else {
64 return false; 68 return false;
65 } 69 }
66 return true; 70 return true;
67 } 71 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698