OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 module content; | 5 module content; |
6 | 6 |
7 import "content/public/common/permission_status.mojom"; | 7 import "content/public/common/permission_status.mojom"; |
8 | 8 |
9 enum PermissionName { | 9 enum PermissionName { |
10 GEOLOCATION, | 10 GEOLOCATION, |
11 NOTIFICATIONS, | 11 NOTIFICATIONS, |
12 PUSH_NOTIFICATIONS, | 12 PUSH_NOTIFICATIONS, |
13 MIDI, | 13 MIDI, |
14 MIDI_SYSEX, | 14 MIDI_SYSEX, |
15 PROTECTED_MEDIA_IDENTIFIER, | 15 PROTECTED_MEDIA_IDENTIFIER, |
16 DURABLE_STORAGE, | 16 DURABLE_STORAGE, |
17 }; | 17 }; |
18 | 18 |
19 // The Permission service provides permission handling capabilities by exposing | 19 // The Permission service provides permission handling capabilities by exposing |
20 // methods to check, request, and revoke permissions. It also allows a client to | 20 // methods to check, request, and revoke permissions. It also allows a client to |
21 // start listening to permission changes. | 21 // start listening to permission changes. |
22 interface PermissionService { | 22 interface PermissionService { |
23 HasPermission(PermissionName permission, string origin) | 23 HasPermission(PermissionName permission, string origin) |
24 => (PermissionStatus status); | 24 => (PermissionStatus status); |
25 RequestPermission(PermissionName permission, string origin, bool user_gesture) | 25 RequestPermission(PermissionName permission, string origin, bool user_gesture) |
26 => (PermissionStatus status); | 26 => (PermissionStatus status); |
27 RequestBatchPermission(array<PermissionName> permission, string origin, bool u ser_gesture) | |
mlamouri (slow - plz ping)
2015/08/21 10:24:41
Would Mojo be happy if we were to do overloading?
Lalit Maganti
2015/08/21 12:56:00
No Mojo doesn't support overloading which is why I
| |
28 => (array<PermissionStatus> statuses); | |
27 RevokePermission(PermissionName permission, string origin) | 29 RevokePermission(PermissionName permission, string origin) |
28 => (PermissionStatus status); | 30 => (PermissionStatus status); |
29 | 31 |
30 // Runs the callback next time there is a permission status change for the | 32 // Runs the callback next time there is a permission status change for the |
31 // given { permission, origin }. Callers of this method will have to call it | 33 // given { permission, origin }. Callers of this method will have to call it |
32 // again if they want to keep listening to the changes. To prevent race | 34 // again if they want to keep listening to the changes. To prevent race |
33 // conditions, the caller must pass the last known value. | 35 // conditions, the caller must pass the last known value. |
34 GetNextPermissionChange(PermissionName permission, | 36 GetNextPermissionChange(PermissionName permission, |
35 string origin, | 37 string origin, |
36 PermissionStatus last_known_status) | 38 PermissionStatus last_known_status) |
37 => (PermissionStatus status); | 39 => (PermissionStatus status); |
38 }; | 40 }; |
OLD | NEW |