OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
6 /** | 6 /** |
7 * This file contains the <code>PPB_Talk</code> interface. | 7 * This file contains the <code>PPB_Talk_Private</code> interface. |
8 */ | 8 */ |
9 label Chrome { | 9 label Chrome { |
10 M19 = 1.0 | 10 M19 = 1.0, |
| 11 M29 = 2.0 |
11 }; | 12 }; |
12 | 13 |
13 /** | 14 /** |
| 15 * The type of permissions that can be requested from the user. |
| 16 */ |
| 17 [assert_size(4)] |
| 18 enum PP_TalkPermission { |
| 19 /** |
| 20 * Request permission for screencast. |
| 21 */ |
| 22 PP_TALKPERMISSION_SCREENCAST = 0, |
| 23 /** |
| 24 * Request permission for Remote Desktop. |
| 25 */ |
| 26 PP_TALKPERMISSION_REMOTING = 1, |
| 27 /** |
| 28 * Request permission for continuing Remote Desktop. |
| 29 */ |
| 30 PP_TALKPERMISSION_REMOTING_CONTINUE = 2 |
| 31 }; |
| 32 |
| 33 /** |
| 34 * Talk event types reported by the browser. |
| 35 */ |
| 36 [assert_size(4)] |
| 37 enum PP_TalkEvent { |
| 38 /** |
| 39 * Indicates that the user took action to terminate the remoting session. |
| 40 */ |
| 41 PP_TALKEVENT_TERMINATE = 0, |
| 42 /** |
| 43 * Indicates that an error occurred (e.g. failed to show the UI). |
| 44 */ |
| 45 PP_TALKEVENT_ERROR = 1 |
| 46 }; |
| 47 |
| 48 /** |
| 49 * Callback for Talk events. |
| 50 */ |
| 51 typedef void PP_TalkEventCallback([inout] mem_t user_data, |
| 52 [in] PP_TalkEvent event); |
| 53 |
| 54 /** |
14 * Extra interface for Talk. | 55 * Extra interface for Talk. |
15 */ | 56 */ |
16 interface PPB_Talk_Private { | 57 interface PPB_Talk_Private { |
17 /** | 58 /** |
18 * Creates a Talk_Private resource. | 59 * Creates a Talk_Private resource. |
19 */ | 60 */ |
| 61 [version=1.0] |
20 PP_Resource Create(PP_Instance instance); | 62 PP_Resource Create(PP_Instance instance); |
21 | 63 |
22 /** | 64 /** |
23 * Displays security UI. | 65 * Displays confirmation dialog for screencasting. |
24 * | 66 * |
25 * The callback will be issued with 1 as the result if the user gave | 67 * The callback will be issued with 1 as the result if the user gave |
26 * permission, or 0 if the user denied. | 68 * permission, or 0 if the user denied. |
27 * | 69 * |
28 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING | 70 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING |
29 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a | 71 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a |
30 * request in progress. | 72 * request in progress. |
| 73 * |
| 74 * (Deprecated in 2.0. Please us RequestPermission instead.) |
| 75 */ |
| 76 [version=1.0, deprecate=2.0] |
| 77 int32_t GetPermission( |
| 78 [in] PP_Resource talk_resource, |
| 79 [in] PP_CompletionCallback callback); |
| 80 |
| 81 /** |
| 82 * Requests permission from the user using a system modal dialog. |
| 83 * |
| 84 * <code>permission</code> specifies the type of permission to request from |
| 85 * the user. |
| 86 * |
| 87 * <code>callback</code> is the completion callback. It will be issued with 1 |
| 88 * as the result if the user gave permission, or 0 if the user denied. |
| 89 * |
| 90 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING |
| 91 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a |
| 92 * request in progress. |
31 */ | 93 */ |
32 int32_t GetPermission( | 94 [version=2.0] |
| 95 int32_t RequestPermission( |
| 96 [in] PP_Resource talk_resource, |
| 97 [in] PP_TalkPermission permission, |
| 98 [in] PP_CompletionCallback callback); |
| 99 |
| 100 /** |
| 101 * Shows the remoting-in-progress UI and registers a callback for events. |
| 102 * |
| 103 * <code>event_callback</code> is the callback for session releated events. |
| 104 * It will only start receiving events after the completion callback has been |
| 105 * issued. This callback will be called on the pepper main thread. |
| 106 * |
| 107 * <code>user_data</code> is an opaque value used when |
| 108 * <code>event_callback</code> is invoked. |
| 109 * |
| 110 * <code>callback</code> is the completion callback. |
| 111 * |
| 112 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING |
| 113 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a |
| 114 * request in progress. PP_ERROR_INPROGRESS will also be returned if a |
| 115 * previous call to StartRemoting succeeded without a corresponding |
| 116 * StopRemoting call. |
| 117 */ |
| 118 [version=2.0] |
| 119 int32_t StartRemoting( |
| 120 [in] PP_Resource talk_resource, |
| 121 [in] PP_TalkEventCallback event_callback, |
| 122 [inout] mem_t user_data, |
| 123 [in] PP_CompletionCallback callback); |
| 124 |
| 125 /** |
| 126 * Hides the remoting-in-progress UI and unregisters the event callback. |
| 127 * |
| 128 * <code>callback</code> is the completion callback. |
| 129 */ |
| 130 [version=2.0] |
| 131 int32_t StopRemoting( |
33 [in] PP_Resource talk_resource, | 132 [in] PP_Resource talk_resource, |
34 [in] PP_CompletionCallback callback); | 133 [in] PP_CompletionCallback callback); |
35 }; | 134 }; |
OLD | NEW |