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
3 * found in the LICENSE file.
7 * This file contains the <code>PPB_Talk_Private</code> interface.
15 * The type of permissions that can be requested from the user.
18 enum PP_TalkPermission
{
20 * Request permission for screencast.
22 PP_TALKPERMISSION_SCREENCAST
,
24 * Request permission for Remote Desktop.
26 PP_TALKPERMISSION_REMOTING
,
28 * Request permission for continuing Remote Desktop.
30 PP_TALKPERMISSION_REMOTING_CONTINUE
,
32 * Number of permissions.
34 PP_TALKPERMISSION_NUM_PERMISSIONS
38 * Talk event types reported by the browser.
43 * Indicates that the user took action to terminate the remoting session.
45 PP_TALKEVENT_TERMINATE
,
47 * Indicates that an error occurred (e.g. failed to show the UI).
53 PP_TALKEVENT_NUM_EVENTS
57 * Callback for Talk events.
59 typedef void PP_TalkEventCallback
([inout
] mem_t user_data
,
60 [in] PP_TalkEvent event
);
63 * Extra interface for Talk.
65 interface PPB_Talk_Private
{
67 * Creates a Talk_Private resource.
70 PP_Resource Create
(PP_Instance instance
);
73 * Displays confirmation dialog for screencasting.
75 * The callback will be issued with 1 as the result if the user gave
76 * permission, or 0 if the user denied.
78 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING
79 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a
80 * request in progress.
82 * (Deprecated in 2.0. Please us RequestPermission instead.)
84 [version=1.0, deprecate
=2.0]
85 int32_t GetPermission
(
86 [in] PP_Resource talk_resource
,
87 [in] PP_CompletionCallback
callback);
90 * Requests permission from the user using a system modal dialog.
92 * <code>permission</code> specifies the type of permission to request from
95 * <code>callback</code> is the completion callback. It will be issued with 1
96 * as the result if the user gave permission, or 0 if the user denied.
98 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING
99 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a
100 * request in progress.
103 int32_t RequestPermission
(
104 [in] PP_Resource talk_resource
,
105 [in] PP_TalkPermission permission
,
106 [in] PP_CompletionCallback
callback);
109 * Shows the remoting-in-progress UI and registers a callback for events.
111 * <code>event_callback</code> is the callback for session releated events.
112 * It will only start receiving events after the completion callback has been
113 * issued. This callback will be called on the pepper main thread.
115 * <code>user_data</code> is an opaque value used when
116 * <code>event_callback</code> is invoked.
118 * <code>callback</code> is the completion callback.
120 * You can only have one call pending. It will return PP_OK_COMPLETIONPENDING
121 * if the request is queued, or PP_ERROR_INPROGRESS if there is already a
122 * request in progress. PP_ERROR_INPROGRESS will also be returned if a
123 * previous call to StartRemoting succeeded without a corresponding
127 int32_t StartRemoting
(
128 [in] PP_Resource talk_resource
,
129 [in] PP_TalkEventCallback event_callback
,
130 [inout
] mem_t user_data
,
131 [in] PP_CompletionCallback
callback);
134 * Hides the remoting-in-progress UI and unregisters the event callback.
136 * <code>callback</code> is the completion callback.
139 int32_t StopRemoting
(
140 [in] PP_Resource talk_resource
,
141 [in] PP_CompletionCallback
callback);