• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 */
5
6/**
7 * This file contains the <code>PPB_Talk_Private</code> interface.
8 */
9label Chrome {
10  M19 = 1.0,
11  M29 = 2.0
12};
13
14/**
15 * The type of permissions that can be requested from the user.
16 */
17[assert_size(4)]
18enum PP_TalkPermission {
19  /**
20   * Request permission for screencast.
21   */
22  PP_TALKPERMISSION_SCREENCAST,
23  /**
24   * Request permission for Remote Desktop.
25   */
26  PP_TALKPERMISSION_REMOTING,
27  /**
28   * Request permission for continuing Remote Desktop.
29   */
30  PP_TALKPERMISSION_REMOTING_CONTINUE,
31  /**
32   * Number of permissions.
33   */
34  PP_TALKPERMISSION_NUM_PERMISSIONS
35};
36
37/**
38 * Talk event types reported by the browser.
39 */
40[assert_size(4)]
41enum PP_TalkEvent {
42  /**
43   * Indicates that the user took action to terminate the remoting session.
44   */
45  PP_TALKEVENT_TERMINATE,
46  /**
47   * Indicates that an error occurred (e.g. failed to show the UI).
48   */
49  PP_TALKEVENT_ERROR,
50  /**
51   * Number of events
52   */
53  PP_TALKEVENT_NUM_EVENTS
54};
55
56/**
57 * Callback for Talk events.
58 */
59typedef void PP_TalkEventCallback([inout] mem_t user_data,
60                                  [in] PP_TalkEvent event);
61
62/**
63 * Extra interface for Talk.
64 */
65interface PPB_Talk_Private {
66  /**
67   * Creates a Talk_Private resource.
68   */
69  [version=1.0]
70  PP_Resource Create(PP_Instance instance);
71
72  /**
73   * Displays confirmation dialog for screencasting.
74   *
75   * The callback will be issued with 1 as the result if the user gave
76   * permission, or 0 if the user denied.
77   *
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.
81   *
82   * (Deprecated in 2.0. Please us RequestPermission instead.)
83   */
84  [version=1.0, deprecate=2.0]
85  int32_t GetPermission(
86      [in] PP_Resource talk_resource,
87      [in] PP_CompletionCallback callback);
88
89  /**
90   * Requests permission from the user using a system modal dialog.
91   *
92   * <code>permission</code> specifies the type of permission to request from
93   * the user.
94   *
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.
97   *
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.
101   */
102  [version=2.0]
103  int32_t RequestPermission(
104      [in] PP_Resource talk_resource,
105      [in] PP_TalkPermission permission,
106      [in] PP_CompletionCallback callback);
107
108  /**
109   * Shows the remoting-in-progress UI and registers a callback for events.
110   *
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.
114   *
115   * <code>user_data</code> is an opaque value used when
116   * <code>event_callback</code> is invoked.
117   *
118   * <code>callback</code> is the completion callback.
119   *
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
124   * StopRemoting call.
125   */
126  [version=2.0]
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);
132
133  /**
134   * Hides the remoting-in-progress UI and unregisters the event callback.
135   *
136   * <code>callback</code> is the completion callback.
137   */
138  [version=2.0]
139  int32_t StopRemoting(
140      [in] PP_Resource talk_resource,
141      [in] PP_CompletionCallback callback);
142};
143