| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 module content.mojom; | |
| 6 | |
| 7 import "content/public/common/permission_status.mojom"; | |
| 8 | |
| 9 enum PermissionName { | |
| 10 GEOLOCATION, | |
| 11 NOTIFICATIONS, | |
| 12 PUSH_NOTIFICATIONS, | |
| 13 MIDI, | |
| 14 MIDI_SYSEX, | |
| 15 PROTECTED_MEDIA_IDENTIFIER, | |
| 16 DURABLE_STORAGE, | |
| 17 AUDIO_CAPTURE, | |
| 18 VIDEO_CAPTURE, | |
| 19 }; | |
| 20 | |
| 21 // The Permission service provides permission handling capabilities by exposing | |
| 22 // methods to check, request, and revoke permissions. It also allows a client to | |
| 23 // start listening to permission changes. | |
| 24 interface PermissionService { | |
| 25 HasPermission(PermissionName permission, string origin) | |
| 26 => (PermissionStatus status); | |
| 27 RequestPermission(PermissionName permission, string origin) | |
| 28 => (PermissionStatus status); | |
| 29 RequestPermissions(array<PermissionName> permission, string origin) | |
| 30 => (array<PermissionStatus> statuses); | |
| 31 RevokePermission(PermissionName permission, string origin) | |
| 32 => (PermissionStatus status); | |
| 33 | |
| 34 // Runs the callback next time there is a permission status change for the | |
| 35 // given { permission, origin }. Callers of this method will have to call it | |
| 36 // again if they want to keep listening to the changes. To prevent race | |
| 37 // conditions, the caller must pass the last known value. | |
| 38 GetNextPermissionChange(PermissionName permission, | |
| 39 string origin, | |
| 40 PermissionStatus last_known_status) | |
| 41 => (PermissionStatus status); | |
| 42 }; | |
| OLD | NEW |