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

Side by Side Diff: chrome/browser/permissions/permission_manager.cc

Issue 2791623004: [sensors][permission] Add new permission types in permission module. (Closed)
Patch Set: Rebase Created 3 years, 5 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_manager.h" 5 #include "chrome/browser/permissions/permission_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 case PermissionType::DURABLE_STORAGE: 97 case PermissionType::DURABLE_STORAGE:
98 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE; 98 return CONTENT_SETTINGS_TYPE_DURABLE_STORAGE;
99 case PermissionType::AUDIO_CAPTURE: 99 case PermissionType::AUDIO_CAPTURE:
100 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC; 100 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC;
101 case PermissionType::VIDEO_CAPTURE: 101 case PermissionType::VIDEO_CAPTURE:
102 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; 102 return CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
103 case PermissionType::BACKGROUND_SYNC: 103 case PermissionType::BACKGROUND_SYNC:
104 return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC; 104 return CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC;
105 case PermissionType::FLASH: 105 case PermissionType::FLASH:
106 return CONTENT_SETTINGS_TYPE_PLUGINS; 106 return CONTENT_SETTINGS_TYPE_PLUGINS;
107 // TODO(riju): Add ContentSetting entries for sensors later.
raymes 2017/07/19 02:42:10 We probably only want to add 1 ContentSettingsType
Reilly Grant (use Gerrit) 2017/07/19 21:30:27 I'm tempted to say that even adding multiple Permi
riju_ 2017/07/20 11:07:40 Done.
108 case PermissionType::AMBIENT_LIGHT_SENSOR:
109 return CONTENT_SETTINGS_TYPE_DEFAULT;
110 case PermissionType::ACCELEROMETER:
111 return CONTENT_SETTINGS_TYPE_DEFAULT;
112 case PermissionType::GYROSCOPE:
113 return CONTENT_SETTINGS_TYPE_DEFAULT;
114 case PermissionType::MAGNETOMETER:
115 return CONTENT_SETTINGS_TYPE_DEFAULT;
107 case PermissionType::NUM: 116 case PermissionType::NUM:
108 // This will hit the NOTREACHED below. 117 // This will hit the NOTREACHED below.
109 break; 118 break;
110 } 119 }
111 120
112 NOTREACHED() << "Unknown content setting for permission " 121 NOTREACHED() << "Unknown content setting for permission "
113 << static_cast<int>(permission); 122 << static_cast<int>(permission);
114 return CONTENT_SETTINGS_TYPE_DEFAULT; 123 return CONTENT_SETTINGS_TYPE_DEFAULT;
115 } 124 }
116 125
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 const GURL& embedding_origin) { 585 const GURL& embedding_origin) {
577 PermissionContextBase* context = GetPermissionContext(permission); 586 PermissionContextBase* context = GetPermissionContext(permission);
578 PermissionResult result = context->GetPermissionStatus( 587 PermissionResult result = context->GetPermissionStatus(
579 render_frame_host, requesting_origin.GetOrigin(), 588 render_frame_host, requesting_origin.GetOrigin(),
580 embedding_origin.GetOrigin()); 589 embedding_origin.GetOrigin());
581 DCHECK(result.content_setting == CONTENT_SETTING_ALLOW || 590 DCHECK(result.content_setting == CONTENT_SETTING_ALLOW ||
582 result.content_setting == CONTENT_SETTING_ASK || 591 result.content_setting == CONTENT_SETTING_ASK ||
583 result.content_setting == CONTENT_SETTING_BLOCK); 592 result.content_setting == CONTENT_SETTING_BLOCK);
584 return result; 593 return result;
585 } 594 }
OLDNEW
« no previous file with comments | « android_webview/browser/aw_permission_manager.cc ('k') | content/browser/permissions/permission_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698