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

Unified Diff: chrome/browser/permissions/permission_manager.cc

Issue 2788483006: [sensors][permission] Constant permission for Acceleromter and Gyroscope.
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_manager.cc
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc
index 6fcdfe10f3a0a7cd57bc71881b50ff414e801369..94a2ae711dd62234bfb2154f8c2c4ec2ee45434d 100644
--- a/chrome/browser/permissions/permission_manager.cc
+++ b/chrome/browser/permissions/permission_manager.cc
@@ -126,7 +126,9 @@ ContentSettingsType PermissionTypeToContentSetting(PermissionType permission) {
// The ContentSettingsTypes for which true is returned will also return nullptr
// in PermissionManager::GetPermissionContext since they don't have a context.
bool IsConstantPermission(ContentSettingsType type) {
- return type == CONTENT_SETTINGS_TYPE_MIDI;
+ return (type == CONTENT_SETTINGS_TYPE_MIDI ||
+ CONTENT_SETTINGS_TYPE_ACCELEROMETER ||
+ CONTENT_SETTINGS_TYPE_GYROSCOPE);
}
void SubscriptionCallbackWrapper(
@@ -170,6 +172,10 @@ ContentSetting GetContentSettingForConstantPermission(
switch (type) {
case CONTENT_SETTINGS_TYPE_MIDI:
return CONTENT_SETTING_ALLOW;
+ case CONTENT_SETTINGS_TYPE_ACCELEROMETER:
+ return CONTENT_SETTING_ALLOW;
+ case CONTENT_SETTINGS_TYPE_GYROSCOPE:
+ return CONTENT_SETTING_ALLOW;
default:
return CONTENT_SETTING_BLOCK;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698