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

Side by Side Diff: remoting/webapp/client_plugin_interface.js

Issue 552403004: Interfaceify ClientPlugin in preparation for mocking it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Interfaceify more classes. Created 6 years, 3 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
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
Sergey Ulanov 2014/09/16 02:02:51 year remove (c)
Jamie 2014/09/16 16:23:20 Done.
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 * @fileoverview
7 * Interface abstracting the ClientPlugin functionality.
8 */
9
10 'use strict';
11
12 /** @suppress {duplicate} */
13 var remoting = remoting || {};
14
15 /**
16 * @interface
17 * @extends {base.Disposable}
18 */
19 remoting.ClientPluginInterface = function() {};
Sergey Ulanov 2014/09/16 02:02:51 IMO it would be better to call abstract interface
Jamie 2014/09/16 16:23:21 I agree. The problem is that we're expecting a mer
20
21 /**
22 * @return {number} The width of the remote desktop, in pixels.
23 */
24 remoting.ClientPluginInterface.prototype.getDesktopWidth = function() {};
25
26 /**
27 * @return {number} The height of the remote desktop, in pixels.
28 */
29 remoting.ClientPluginInterface.prototype.getDesktopHeight = function() {};
30
31 /**
32 * @return {number} The x-DPI of the remote desktop.
33 */
34 remoting.ClientPluginInterface.prototype.getDesktopXDpi = function() {};
35
36 /**
37 * @return {number} The y-DPI of the remote desktop.
38 */
39 remoting.ClientPluginInterface.prototype.getDesktopYDpi = function() {};
40
41 /**
42 * @return {HTMLElement} The DOM element representing the remote session.
43 */
44 remoting.ClientPluginInterface.prototype.element = function() {};
45
46 /**
47 * @param {function():void} onDone Completion callback.
48 */
49 remoting.ClientPluginInterface.prototype.initialize = function(onDone) {};
50
51 /**
52 * @param {string} hostJid The jid of the host to connect to.
53 * @param {string} hostPublicKey The base64 encoded version of the host's
54 * public key.
55 * @param {string} localJid Local jid.
56 * @param {string} sharedSecret The access code for IT2Me or the PIN
57 * for Me2Me.
58 * @param {string} authenticationMethods Comma-separated list of
59 * authentication methods the client should attempt to use.
60 * @param {string} authenticationTag A host-specific tag to mix into
61 * authentication hashes.
62 * @param {string} clientPairingId For paired Me2Me connections, the
63 * pairing id for this client, as issued by the host.
64 * @param {string} clientPairedSecret For paired Me2Me connections, the
65 * paired secret for this client, as issued by the host.
66 */
67 remoting.ClientPluginInterface.prototype.connect = function(
68 hostJid, hostPublicKey, localJid, sharedSecret,
69 authenticationMethods, authenticationTag,
70 clientPairingId, clientPairedSecret) {};
71
72 /**
73 * @param {number} key The keycode to inject.
74 * @param {boolean} down True for press; false for a release.
75 */
76 remoting.ClientPluginInterface.prototype.injectKeyEvent =
77 function(key, down) {};
78
79 /**
80 * @param {number} from
81 * @param {number} to
82 */
83 remoting.ClientPluginInterface.prototype.remapKey = function(from, to) {};
84
85 /**
86 * Release all keys currently being pressed.
87 */
88 remoting.ClientPluginInterface.prototype.releaseAllKeys = function() {};
89
90 /**
91 * @param {number} width
92 * @param {number} height
93 * @param {number} dpi
94 */
95 remoting.ClientPluginInterface.prototype.notifyClientResolution =
96 function(width, height, dpi) {};
97
98 /**
99 * @param {string} iq
100 */
101 remoting.ClientPluginInterface.prototype.onIncomingIq = function(iq) {};
102
103 /**
104 * @return {boolean} True if the web-app and plugin are compatible.
105 */
106 remoting.ClientPluginInterface.prototype.isSupportedVersion = function() {};
107
108 /**
109 * @param {remoting.ClientPlugin.Feature} feature
110 * @return {boolean} True if the plugin support the specified feature.
111 */
112 remoting.ClientPluginInterface.prototype.hasFeature = function(feature) {};
113
114 /**
115 * Enable MediaSource rendering via the specified renderer.
116 *
117 * @param {remoting.MediaSourceRenderer} mediaSourceRenderer
118 */
119 remoting.ClientPluginInterface.prototype.enableMediaSourceRendering =
120 function(mediaSourceRenderer) {};
121
122 /**
123 * Sends a clipboard item to the host.
124 *
125 * @param {string} mimeType The MIME type of the clipboard item.
126 * @param {string} item The clipboard item.
127 */
128 remoting.ClientPluginInterface.prototype.sendClipboardItem =
129 function(mimeType, item) {};
130
131 /**
132 * Tell the plugin to request a PIN asynchronously.
133 */
134 remoting.ClientPluginInterface.prototype.useAsyncPinDialog = function() {};
135
136 /**
137 * Request that this client be paired with the current host.
138 *
139 * @param {string} clientName The human-readable name of the client.
140 * @param {function(string, string):void} onDone Callback to receive the
141 * client id and shared secret when they are available.
142 */
143 remoting.ClientPluginInterface.prototype.requestPairing =
144 function(clientName, onDone) {};
145
146 /**
147 * Called when a PIN is obtained from the user.
148 *
149 * @param {string} pin The PIN.
150 */
151 remoting.ClientPluginInterface.prototype.onPinFetched = function(pin) {};
152
153 /**
154 * Sets the third party authentication token and shared secret.
155 *
156 * @param {string} token The token received from the token URL.
157 * @param {string} sharedSecret Shared secret received from the token URL.
158 */
159 remoting.ClientPluginInterface.prototype.onThirdPartyTokenFetched =
160 function(token, sharedSecret) {};
161
162 /**
163 * @param {boolean} pause True to pause the audio stream; false to resume it.
164 */
165 remoting.ClientPluginInterface.prototype.pauseAudio = function(pause) {};
166
167 /**
168 * @param {boolean} pause True to pause the video stream; false to resume it.
169 */
170 remoting.ClientPluginInterface.prototype.pauseVideo = function(pause) {};
171
172 /**
173 * @return {remoting.ClientSession.PerfStats} A summary of the connection
174 * performance.
175 */
176 remoting.ClientPluginInterface.prototype.getPerfStats = function() {};
177
178 /**
179 * Send an extension message to the host.
180 *
181 * @param {string} name
182 * @param {string} data
183 */
184 remoting.ClientPluginInterface.prototype.sendClientMessage =
185 function(name, data) {};
186
187 /**
188 * @param {function(string):void} handler Callback for sending an IQ stanza.
189 */
190 remoting.ClientPluginInterface.prototype.setOnOutgoingIqHandler =
191 function(handler) {};
192
193 /**
194 * @param {function(string):void} handler Callback for logging debug messages.
195 */
196 remoting.ClientPluginInterface.prototype.setOnDebugMessageHandler =
197 function(handler) {};
198
199 /**
200 * @param {function(number, number):void} handler Callback for connection status
201 * update notifications. The first parameter is the connection state; the
202 * second is the error code, if any.
203 */
204 remoting.ClientPluginInterface.prototype.setConnectionStatusUpdateHandler =
205 function(handler) {};
206
207 /**
208 * @param {function(boolean):void} handler Callback for connection readiness
209 * notifications.
210 */
211 remoting.ClientPluginInterface.prototype.setConnectionReadyHandler =
212 function(handler) {};
213
214 /**
215 * @param {function():void} handler Callback for desktop size change
216 * notifications.
217 */
218 remoting.ClientPluginInterface.prototype.setDesktopSizeUpdateHandler =
219 function(handler) {};
220
221 /**
222 * @param {function(!Array.<string>):void} handler Callback to inform of
223 * capabilities negotiated between host and client.
224 */
225 remoting.ClientPluginInterface.prototype.setCapabilitiesHandler =
226 function(handler) {};
227
228 /**
229 * @param {function(string):void} handler Callback for processing security key
230 * (Gnubby) protocol messages.
231 */
232 remoting.ClientPluginInterface.prototype.setGnubbyAuthHandler =
233 function(handler) {};
234
235 /**
236 * @param {function(string):void} handler Callback for processing Cast protocol
237 * messages.
238 */
239 remoting.ClientPluginInterface.prototype.setCastExtensionHandler =
240 function(handler) {};
241
242 /**
243 * @param {function(string, number, number):void} handler Callback for
244 * processing large mouse cursor images. The first parameter is a data:
245 * URL encoding the mouse cursor; the second and third parameters are
246 * the cursor hotspot's x- and y-coordinates, respectively.
247 */
248 remoting.ClientPluginInterface.prototype.setMouseCursorHandler =
249 function(handler) {};
250
251 /**
252 * @param {function(string, string, string):void} handler Callback for
253 * fetching third-party tokens. The first parameter is the token URL; the
254 * second is the public key of the host; the third is the OAuth2 scope
255 * being requested.
256 */
257 remoting.ClientPluginInterface.prototype.setFetchThirdPartyTokenHandler =
258 function(handler) {};
259
260 /**
261 * @param {function(boolean):void} handler Callback for fetching a PIN from
262 * the user. The parameter is true if PIN pairing is supported by the
263 * host, or false otherwise.
264 */
265 remoting.ClientPluginInterface.prototype.setFetchPinHandler =
266 function(handler) {};
267
268
269 /**
270 * @interface
271 */
272 remoting.ClientPluginFactory = function() {};
273
274 /**
275 * @param {Element} container The container for the embed element.
276 * @param {function(string, string):boolean} onExtensionMessage The handler for
277 * protocol extension messages. Returns true if a message is recognized;
278 * false otherwise.
279 * @return {remoting.ClientPluginInterface} A new client plugin instance.
280 */
281 remoting.ClientPluginFactory.prototype.createPlugin =
282 function(container, onExtensionMessage) {};
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698