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

Side by Side Diff: ppapi/c/private/ppb_talk_private.h

Issue 16271005: Implement pepper interface and plumbing for HRD's UI on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implemented requested changes. Created 7 years, 6 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 (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 Tue Jun 4 14:51:44 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 * The type of permissions that can be requested from the user.
33 */
34 typedef enum {
35 /**
36 * Request permission for screencast.
37 */
38 PP_TALKPERMISSION_SCREENCAST = 0,
39 /**
40 * Request permission for Remote Desktop.
41 */
42 PP_TALKPERMISSION_REMOTING = 1,
43 /**
44 * Request permission for continuing Remote Desktop.
45 */
46 PP_TALKPERMISSION_REMOTING_CONTINUE = 2
47 } PP_TalkPermission;
48 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkPermission, 4);
49
50 /**
51 * Talk event types reported by the browser.
52 */
53 typedef enum {
54 /**
55 * Indicates that the user took action to terminate the remoting session.
56 */
57 PP_TALKEVENT_TERMINATE = 0,
58 /**
59 * Indicates that an error occurred (e.g. failed to show the UI).
60 */
61 PP_TALKEVENT_ERROR = 1
62 } PP_TalkEvent;
63 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TalkEvent, 4);
64 /**
65 * @}
66 */
67
68 /**
69 * @addtogroup Typedefs
70 * @{
71 */
72 /**
73 * Callback for Talk events.
74 */
75 typedef void (*PP_TalkEventCallback)(void* user_data, PP_TalkEvent event);
76 /**
77 * @}
78 */
79
80 /**
27 * @addtogroup Interfaces 81 * @addtogroup Interfaces
28 * @{ 82 * @{
29 */ 83 */
30 /** 84 /**
31 * Extra interface for Talk. 85 * Extra interface for Talk.
32 */ 86 */
33 struct PPB_Talk_Private_1_0 { 87 struct PPB_Talk_Private_2_0 {
34 /** 88 /**
35 * Creates a Talk_Private resource. 89 * Creates a Talk_Private resource.
36 */ 90 */
37 PP_Resource (*Create)(PP_Instance instance); 91 PP_Resource (*Create)(PP_Instance instance);
38 /** 92 /**
39 * Displays security UI. 93 * Requests permission from the user using a system modal dialog.
94 *
95 * <code>permission</code> specifies the type of permission to request from
96 * the user.
40 * 97 *
41 * The callback will be issued with 1 as the result if the user gave 98 * The callback will be issued with 1 as the result if the user gave
42 * permission, or 0 if the user denied. 99 * permission, or 0 if the user denied.
43 * 100 *
44 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING 101 * 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 102 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a
46 * request in progress. 103 * request in progress.
47 */ 104 */
105 int32_t (*RequestPermission)(PP_Resource talk_resource,
106 PP_TalkPermission permission,
107 struct PP_CompletionCallback callback);
108 /**
109 * Shows the remoting-in-progress UI and registers a callback for events.
110 * This function executes synchronously. Returns PP_OK if there were no
111 * errors.
112 *
113 * This must be called on the pepper main thread. Similarly, |event_callback|
114 * will be called on the pepper main thread.
115 */
116 int32_t (*StartRemoting)(PP_Resource talk_resource,
117 PP_TalkEventCallback event_callback,
118 void* user_data);
119 /**
120 * Hides the remoting-in-progress UI and unregisters the event callback.
121 *
122 * This must be called on the pepper main thread. Any pending notifications
123 * will be discarded.
124 */
125 void (*StopRemoting)(PP_Resource talk_resource);
126 };
127
128 typedef struct PPB_Talk_Private_2_0 PPB_Talk_Private;
129
130 struct PPB_Talk_Private_1_0 {
131 PP_Resource (*Create)(PP_Instance instance);
48 int32_t (*GetPermission)(PP_Resource talk_resource, 132 int32_t (*GetPermission)(PP_Resource talk_resource,
49 struct PP_CompletionCallback callback); 133 struct PP_CompletionCallback callback);
50 }; 134 };
51
52 typedef struct PPB_Talk_Private_1_0 PPB_Talk_Private;
53 /** 135 /**
54 * @} 136 * @}
55 */ 137 */
56 138
57 #endif /* PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ */ 139 #endif /* PPAPI_C_PRIVATE_PPB_TALK_PRIVATE_H_ */
58 140
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698