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 /* From private/ppb_talk_private.idl modified Fri Nov 9 14:42:36 2012. */ | 6 /* From private/ppb_talk_private.idl modified Fri May 31 13:59:16 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ |
9 #define PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ | 9 #define PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ |
10 | 10 |
11 #include "ppapi/c/pp_completion_callback.h" | 11 #include "ppapi/c/pp_completion_callback.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 | 16 |
17 #define PPB_TALK_PRIVATE_INTERFACE_1_0 "PPB_Talk_Private;1.0" | 17 #define PPB_TALK_PRIVATE_INTERFACE_1_0 "PPB_Talk_Private;1.0" |
18 #define PPB_TALK_PRIVATE_INTERFACE PPB_TALK_PRIVATE_INTERFACE_1_0 | 18 #define PPB_TALK_PRIVATE_INTERFACE_2_0 "PPB_Talk_Private;2.0" |
| 19 #define PPB_TALK_PRIVATE_INTERFACE PPB_TALK_PRIVATE_INTERFACE_2_0 |
19 | 20 |
20 /** | 21 /** |
21 * @file | 22 * @file |
22 * This file contains the <code>PPB_Talk</code> interface. | 23 * This file contains the <code>PPB_Talk_Private</code> interface. |
23 */ | 24 */ |
24 | 25 |
25 | 26 |
26 /** | 27 /** |
| 28 * @addtogroup Enums |
| 29 * @{ |
| 30 */ |
| 31 /** |
| 32 * Talk event types reported by the browser. |
| 33 */ |
| 34 typedef enum { |
| 35 /** |
| 36 * Indicates that the user took action to terminate the remoting session. |
| 37 */ |
| 38 PP_TALKEVENT_TERMINATE = 0, |
| 39 /** |
| 40 * Indicates that an error occurred (e.g. failed to show the UI). |
| 41 */ |
| 42 PP_TALKEVENT_ERROR = 1 |
| 43 } PP_TalkEvent; |
| 44 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkEvent, 4); |
| 45 /** |
| 46 * @} |
| 47 */ |
| 48 |
| 49 /** |
| 50 * @addtogroup Typedefs |
| 51 * @{ |
| 52 */ |
| 53 /** |
| 54 * Callback for Talk events. |
| 55 */ |
| 56 typedef void (*PP_TalkEventCallback)(void* user_data, PP_TalkEvent event); |
| 57 /** |
| 58 * @} |
| 59 */ |
| 60 |
| 61 /** |
27 * @addtogroup Interfaces | 62 * @addtogroup Interfaces |
28 * @{ | 63 * @{ |
29 */ | 64 */ |
30 /** | 65 /** |
31 * Extra interface for Talk. | 66 * Extra interface for Talk. |
32 */ | 67 */ |
33 struct PPB_Talk_Private_1_0 { | 68 struct PPB_Talk_Private_2_0 { |
34 /** | 69 /** |
35 * Creates a Talk_Private resource. | 70 * Creates a Talk_Private resource. |
36 */ | 71 */ |
37 PP_Resource (*Create)(PP_Instance instance); | 72 PP_Resource (*Create)(PP_Instance instance); |
38 /** | 73 /** |
39 * Displays security UI. | 74 * Displays confirmation dialog for screencasting. |
40 * | 75 * |
41 * The callback will be issued with 1 as the result if the user gave | 76 * The callback will be issued with 1 as the result if the user gave |
42 * permission, or 0 if the user denied. | 77 * permission, or 0 if the user denied. |
43 * | 78 * |
44 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING | 79 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING |
45 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a | 80 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a |
46 * request in progress. | 81 * request in progress. |
47 */ | 82 */ |
48 int32_t (*GetPermission)(PP_Resource talk_resource, | 83 int32_t (*GetPermission)(PP_Resource talk_resource, |
49 struct PP_CompletionCallback callback); | 84 struct PP_CompletionCallback callback); |
| 85 /** |
| 86 * Displays confirmation dialog for remoting. |
| 87 * Same parameters and behaviors as <code>GetPermission()</code>. |
| 88 */ |
| 89 int32_t (*GetRemotingPermission)(PP_Resource talk_resource, |
| 90 struct PP_CompletionCallback callback); |
| 91 /** |
| 92 * Displays confirmation dialog for remoting. |
| 93 * Same parameters and behaviors as <code>GetPermission()</code>. |
| 94 */ |
| 95 int32_t (*GetRemotingContinuePermission)( |
| 96 PP_Resource talk_resource, |
| 97 struct PP_CompletionCallback callback); |
| 98 /** |
| 99 * Shows the remoting-in-progress UI and registers a callback for events. |
| 100 * This function executes synchronously. Returns PP_OK if there were no |
| 101 * errors. |
| 102 */ |
| 103 int32_t (*StartRemoting)(PP_Resource talk_resource, |
| 104 PP_TalkEventCallback event_callback, |
| 105 void* user_data); |
| 106 /** |
| 107 * Hides the remoting-in-progress UI and unregisters the event callback. |
| 108 */ |
| 109 void (*StopRemoting)(PP_Resource talk_resource); |
50 }; | 110 }; |
51 | 111 |
52 typedef struct PPB_Talk_Private_1_0 PPB_Talk_Private; | 112 typedef struct PPB_Talk_Private_2_0 PPB_Talk_Private; |
| 113 |
| 114 struct PPB_Talk_Private_1_0 { |
| 115 PP_Resource (*Create)(PP_Instance instance); |
| 116 int32_t (*GetPermission)(PP_Resource talk_resource, |
| 117 struct PP_CompletionCallback callback); |
| 118 }; |
53 /** | 119 /** |
54 * @} | 120 * @} |
55 */ | 121 */ |
56 | 122 |
57 #endif /* PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ */ | 123 #endif /* PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ */ |
58 | 124 |
OLD | NEW |