OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * @fileoverview | 6 * @fileoverview |
7 * This class provides an interface between the HostController and either the | 7 * This class provides an interface between the HostController and either the |
8 * NativeMessaging Host or the Host NPAPI plugin, depending on whether or not | 8 * NativeMessaging Host or the Host NPAPI plugin, depending on whether or not |
9 * NativeMessaging is supported. Since the test for NativeMessaging support is | 9 * NativeMessaging is supported. Since the test for NativeMessaging support is |
10 * asynchronous, this class stores any requests on a queue, pending the result | 10 * asynchronous, this class stores any requests on a queue, pending the result |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 }; | 64 }; |
65 | 65 |
66 /** @enum {number} */ | 66 /** @enum {number} */ |
67 remoting.HostDispatcher.State = { | 67 remoting.HostDispatcher.State = { |
68 UNKNOWN: 0, | 68 UNKNOWN: 0, |
69 NATIVE_MESSAGING: 1, | 69 NATIVE_MESSAGING: 1, |
70 NPAPI: 2 | 70 NPAPI: 2 |
71 }; | 71 }; |
72 | 72 |
73 /** | 73 /** |
74 * @param {function(string):void} callback | 74 * @param {function(string):void} onDone |
75 * @param {function(remoting.Error):void} onError | 75 * @param {function(remoting.Error):void} onError |
76 * @return {void} | 76 * @return {void} |
77 */ | 77 */ |
78 remoting.HostDispatcher.prototype.getHostName = function(callback, onError) { | 78 remoting.HostDispatcher.prototype.getHostName = function(onDone, onError) { |
79 switch (this.state_) { | 79 switch (this.state_) { |
80 case remoting.HostDispatcher.State.UNKNOWN: | 80 case remoting.HostDispatcher.State.UNKNOWN: |
81 this.pendingRequests_.push( | 81 this.pendingRequests_.push( |
82 this.getHostName.bind(this, callback, onError)); | 82 this.getHostName.bind(this, onDone, onError)); |
83 break; | 83 break; |
84 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 84 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
85 this.nativeMessagingHost_.getHostName(callback, onError); | 85 this.nativeMessagingHost_.getHostName(onDone, onError); |
86 break; | 86 break; |
87 case remoting.HostDispatcher.State.NPAPI: | 87 case remoting.HostDispatcher.State.NPAPI: |
88 try { | 88 try { |
89 this.npapiHost_.getHostName(callback); | 89 this.npapiHost_.getHostName(onDone); |
90 } catch (err) { | 90 } catch (err) { |
91 onError(remoting.Error.MISSING_PLUGIN); | 91 onError(remoting.Error.MISSING_PLUGIN); |
92 } | 92 } |
93 break; | 93 break; |
94 } | 94 } |
95 }; | 95 }; |
96 | 96 |
97 /** | 97 /** |
98 * @param {string} hostId | 98 * @param {string} hostId |
99 * @param {string} pin | 99 * @param {string} pin |
100 * @param {function(string):void} callback | 100 * @param {function(string):void} onDone |
101 * @param {function(remoting.Error):void} onError | 101 * @param {function(remoting.Error):void} onError |
102 * @return {void} | 102 * @return {void} |
103 */ | 103 */ |
104 remoting.HostDispatcher.prototype.getPinHash = function(hostId, pin, callback, | 104 remoting.HostDispatcher.prototype.getPinHash = |
105 onError) { | 105 function(hostId, pin, onDone, onError) { |
106 switch (this.state_) { | 106 switch (this.state_) { |
107 case remoting.HostDispatcher.State.UNKNOWN: | 107 case remoting.HostDispatcher.State.UNKNOWN: |
108 this.pendingRequests_.push( | 108 this.pendingRequests_.push( |
109 this.getPinHash.bind(this, hostId, pin, callback, onError)); | 109 this.getPinHash.bind(this, hostId, pin, onDone, onError)); |
110 break; | 110 break; |
111 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 111 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
112 this.nativeMessagingHost_.getPinHash(hostId, pin, callback, onError); | 112 this.nativeMessagingHost_.getPinHash(hostId, pin, onDone, onError); |
113 break; | 113 break; |
114 case remoting.HostDispatcher.State.NPAPI: | 114 case remoting.HostDispatcher.State.NPAPI: |
115 try { | 115 try { |
116 this.npapiHost_.getPinHash(hostId, pin, callback); | 116 this.npapiHost_.getPinHash(hostId, pin, onDone); |
117 } catch (err) { | 117 } catch (err) { |
118 onError(remoting.Error.MISSING_PLUGIN); | 118 onError(remoting.Error.MISSING_PLUGIN); |
119 } | 119 } |
120 break; | 120 break; |
121 } | 121 } |
122 }; | 122 }; |
123 | 123 |
124 /** | 124 /** |
125 * @param {function(string, string):void} callback | 125 * @param {function(string, string):void} onDone |
126 * @param {function(remoting.Error):void} onError | 126 * @param {function(remoting.Error):void} onError |
127 * @return {void} | 127 * @return {void} |
128 */ | 128 */ |
129 remoting.HostDispatcher.prototype.generateKeyPair = function(callback, | 129 remoting.HostDispatcher.prototype.generateKeyPair = function(onDone, onError) { |
130 onError) { | |
131 switch (this.state_) { | 130 switch (this.state_) { |
132 case remoting.HostDispatcher.State.UNKNOWN: | 131 case remoting.HostDispatcher.State.UNKNOWN: |
133 this.pendingRequests_.push( | 132 this.pendingRequests_.push( |
134 this.generateKeyPair.bind(this, callback, onError)); | 133 this.generateKeyPair.bind(this, onDone, onError)); |
135 break; | 134 break; |
136 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 135 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
137 this.nativeMessagingHost_.generateKeyPair(callback, onError); | 136 this.nativeMessagingHost_.generateKeyPair(onDone, onError); |
138 break; | 137 break; |
139 case remoting.HostDispatcher.State.NPAPI: | 138 case remoting.HostDispatcher.State.NPAPI: |
140 try { | 139 try { |
141 this.npapiHost_.generateKeyPair(callback); | 140 this.npapiHost_.generateKeyPair(onDone); |
142 } catch (err) { | 141 } catch (err) { |
143 onError(remoting.Error.MISSING_PLUGIN); | 142 onError(remoting.Error.MISSING_PLUGIN); |
144 } | 143 } |
145 break; | 144 break; |
146 } | 145 } |
147 }; | 146 }; |
148 | 147 |
149 /** | 148 /** |
150 * @param {Object} config | 149 * @param {Object} config |
151 * @param {function(remoting.HostController.AsyncResult):void} callback | 150 * @param {function(remoting.HostController.AsyncResult):void} onDone |
152 * @param {function(remoting.Error):void} onError | 151 * @param {function(remoting.Error):void} onError |
153 * @return {void} | 152 * @return {void} |
154 */ | 153 */ |
155 remoting.HostDispatcher.prototype.updateDaemonConfig = function(config, | 154 remoting.HostDispatcher.prototype.updateDaemonConfig = |
156 callback, | 155 function(config, onDone, onError) { |
157 onError) { | |
158 switch (this.state_) { | 156 switch (this.state_) { |
159 case remoting.HostDispatcher.State.UNKNOWN: | 157 case remoting.HostDispatcher.State.UNKNOWN: |
160 this.pendingRequests_.push( | 158 this.pendingRequests_.push( |
161 this.updateDaemonConfig.bind(this, config, callback, onError)); | 159 this.updateDaemonConfig.bind(this, config, onDone, onError)); |
162 break; | 160 break; |
163 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 161 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
164 this.nativeMessagingHost_.updateDaemonConfig(config, callback, onError); | 162 this.nativeMessagingHost_.updateDaemonConfig(config, onDone, onError); |
165 break; | 163 break; |
166 case remoting.HostDispatcher.State.NPAPI: | 164 case remoting.HostDispatcher.State.NPAPI: |
167 try { | 165 try { |
168 this.npapiHost_.updateDaemonConfig(JSON.stringify(config), callback); | 166 this.npapiHost_.updateDaemonConfig(JSON.stringify(config), onDone); |
169 } catch (err) { | 167 } catch (err) { |
170 onError(remoting.Error.MISSING_PLUGIN); | 168 onError(remoting.Error.MISSING_PLUGIN); |
171 } | 169 } |
172 break; | 170 break; |
173 } | 171 } |
174 }; | 172 }; |
175 | 173 |
176 /** | 174 /** |
177 * @param {function(Object):void} callback | 175 * @param {function(Object):void} onDone |
178 * @param {function(remoting.Error):void} onError | 176 * @param {function(remoting.Error):void} onError |
179 * @return {void} | 177 * @return {void} |
180 */ | 178 */ |
181 remoting.HostDispatcher.prototype.getDaemonConfig = function(callback, | 179 remoting.HostDispatcher.prototype.getDaemonConfig = function(onDone, onError) { |
182 onError) { | |
183 /** | 180 /** |
184 * Converts the config string from the NPAPI plugin to an Object, to pass to | 181 * Converts the config string from the NPAPI plugin to an Object, to pass to |
185 * |callback|. | 182 * |onDone|. |
186 * @param {string} configStr | 183 * @param {string} configStr |
187 * @return {void} | 184 * @return {void} |
188 */ | 185 */ |
189 function callbackForNpapi(configStr) { | 186 function callbackForNpapi(configStr) { |
190 var config = jsonParseSafe(configStr); | 187 var config = jsonParseSafe(configStr); |
191 if (typeof(config) != 'object') { | 188 if (typeof(config) != 'object') { |
192 onError(remoting.Error.UNEXPECTED); | 189 onError(remoting.Error.UNEXPECTED); |
193 } else { | 190 } else { |
194 callback(/** @type {Object} */ (config)); | 191 onDone(/** @type {Object} */ (config)); |
195 } | 192 } |
196 } | 193 } |
197 | 194 |
198 switch (this.state_) { | 195 switch (this.state_) { |
199 case remoting.HostDispatcher.State.UNKNOWN: | 196 case remoting.HostDispatcher.State.UNKNOWN: |
200 this.pendingRequests_.push( | 197 this.pendingRequests_.push( |
201 this.getDaemonConfig.bind(this, callback, onError)); | 198 this.getDaemonConfig.bind(this, onDone, onError)); |
202 break; | 199 break; |
203 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 200 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
204 this.nativeMessagingHost_.getDaemonConfig(callback, onError); | 201 this.nativeMessagingHost_.getDaemonConfig(onDone, onError); |
205 break; | 202 break; |
206 case remoting.HostDispatcher.State.NPAPI: | 203 case remoting.HostDispatcher.State.NPAPI: |
207 try { | 204 try { |
208 this.npapiHost_.getDaemonConfig(callbackForNpapi); | 205 this.npapiHost_.getDaemonConfig(callbackForNpapi); |
209 } catch (err) { | 206 } catch (err) { |
210 onError(remoting.Error.MISSING_PLUGIN); | 207 onError(remoting.Error.MISSING_PLUGIN); |
211 } | 208 } |
212 break; | 209 break; |
213 } | 210 } |
214 }; | 211 }; |
215 | 212 |
216 /** | 213 /** |
217 * @param {function(string):void} callback | 214 * @param {function(string):void} onDone |
218 * @param {function(remoting.Error):void} onError | 215 * @param {function(remoting.Error):void} onError |
219 * @return {void} | 216 * @return {void} |
220 */ | 217 */ |
221 remoting.HostDispatcher.prototype.getDaemonVersion = function(callback, | 218 remoting.HostDispatcher.prototype.getDaemonVersion = function(onDone, onError) { |
222 onError) { | |
223 switch (this.state_) { | 219 switch (this.state_) { |
224 case remoting.HostDispatcher.State.UNKNOWN: | 220 case remoting.HostDispatcher.State.UNKNOWN: |
225 this.pendingRequests_.push( | 221 this.pendingRequests_.push( |
226 this.getDaemonVersion.bind(this, callback, onError)); | 222 this.getDaemonVersion.bind(this, onDone, onError)); |
227 break; | 223 break; |
228 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 224 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
229 callback(this.nativeMessagingHost_.getDaemonVersion()); | 225 onDone(this.nativeMessagingHost_.getDaemonVersion()); |
230 break; | 226 break; |
231 case remoting.HostDispatcher.State.NPAPI: | 227 case remoting.HostDispatcher.State.NPAPI: |
232 try { | 228 try { |
233 this.npapiHost_.getDaemonVersion(callback); | 229 this.npapiHost_.getDaemonVersion(onDone); |
234 } catch (err) { | 230 } catch (err) { |
235 onError(remoting.Error.MISSING_PLUGIN); | 231 onError(remoting.Error.MISSING_PLUGIN); |
236 } | 232 } |
237 break; | 233 break; |
238 } | 234 } |
239 }; | 235 }; |
240 | 236 |
241 /** | 237 /** |
242 * @param {function(boolean, boolean, boolean):void} callback | 238 * @param {function(boolean, boolean, boolean):void} onDone |
243 * @param {function(remoting.Error):void} onError | 239 * @param {function(remoting.Error):void} onError |
244 * @return {void} | 240 * @return {void} |
245 */ | 241 */ |
246 remoting.HostDispatcher.prototype.getUsageStatsConsent = function(callback, | 242 remoting.HostDispatcher.prototype.getUsageStatsConsent = |
247 onError) { | 243 function(onDone, onError) { |
248 switch (this.state_) { | 244 switch (this.state_) { |
249 case remoting.HostDispatcher.State.UNKNOWN: | 245 case remoting.HostDispatcher.State.UNKNOWN: |
250 this.pendingRequests_.push( | 246 this.pendingRequests_.push( |
251 this.getUsageStatsConsent.bind(this, callback, onError)); | 247 this.getUsageStatsConsent.bind(this, onDone, onError)); |
252 break; | 248 break; |
253 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 249 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
254 this.nativeMessagingHost_.getUsageStatsConsent(callback, onError); | 250 this.nativeMessagingHost_.getUsageStatsConsent(onDone, onError); |
255 break; | 251 break; |
256 case remoting.HostDispatcher.State.NPAPI: | 252 case remoting.HostDispatcher.State.NPAPI: |
257 try { | 253 try { |
258 this.npapiHost_.getUsageStatsConsent(callback); | 254 this.npapiHost_.getUsageStatsConsent(onDone); |
259 } catch (err) { | 255 } catch (err) { |
260 onError(remoting.Error.MISSING_PLUGIN); | 256 onError(remoting.Error.MISSING_PLUGIN); |
261 } | 257 } |
262 break; | 258 break; |
263 } | 259 } |
264 }; | 260 }; |
265 | 261 |
266 /** | 262 /** |
267 * @param {Object} config | 263 * @param {Object} config |
268 * @param {boolean} consent | 264 * @param {boolean} consent |
269 * @param {function(remoting.HostController.AsyncResult):void} callback | 265 * @param {function(remoting.HostController.AsyncResult):void} onDone |
270 * @param {function(remoting.Error):void} onError | 266 * @param {function(remoting.Error):void} onError |
271 * @return {void} | 267 * @return {void} |
272 */ | 268 */ |
273 remoting.HostDispatcher.prototype.startDaemon = function(config, consent, | 269 remoting.HostDispatcher.prototype.startDaemon = |
274 callback, onError) { | 270 function(config, consent, onDone, onError) { |
275 switch (this.state_) { | 271 switch (this.state_) { |
276 case remoting.HostDispatcher.State.UNKNOWN: | 272 case remoting.HostDispatcher.State.UNKNOWN: |
277 this.pendingRequests_.push( | 273 this.pendingRequests_.push( |
278 this.startDaemon.bind(this, config, consent, callback, onError)); | 274 this.startDaemon.bind(this, config, consent, onDone, onError)); |
279 break; | 275 break; |
280 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 276 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
281 this.nativeMessagingHost_.startDaemon(config, consent, callback, onError); | 277 this.nativeMessagingHost_.startDaemon(config, consent, onDone, onError); |
282 break; | 278 break; |
283 case remoting.HostDispatcher.State.NPAPI: | 279 case remoting.HostDispatcher.State.NPAPI: |
284 try { | 280 try { |
285 this.npapiHost_.startDaemon(JSON.stringify(config), consent, callback); | 281 this.npapiHost_.startDaemon(JSON.stringify(config), consent, onDone); |
286 } catch (err) { | 282 } catch (err) { |
287 onError(remoting.Error.MISSING_PLUGIN); | 283 onError(remoting.Error.MISSING_PLUGIN); |
288 } | 284 } |
289 break; | 285 break; |
290 } | 286 } |
291 }; | 287 }; |
292 | 288 |
293 /** | 289 /** |
294 * @param {function(remoting.HostController.AsyncResult):void} callback | 290 * @param {function(remoting.HostController.AsyncResult):void} onDone |
295 * @param {function(remoting.Error):void} onError | 291 * @param {function(remoting.Error):void} onError |
296 * @return {void} | 292 * @return {void} |
297 */ | 293 */ |
298 remoting.HostDispatcher.prototype.stopDaemon = function(callback, onError) { | 294 remoting.HostDispatcher.prototype.stopDaemon = function(onDone, onError) { |
299 switch (this.state_) { | 295 switch (this.state_) { |
300 case remoting.HostDispatcher.State.UNKNOWN: | 296 case remoting.HostDispatcher.State.UNKNOWN: |
301 this.pendingRequests_.push(this.stopDaemon.bind(this, callback, onError)); | 297 this.pendingRequests_.push(this.stopDaemon.bind(this, onDone, onError)); |
302 break; | 298 break; |
303 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 299 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
304 this.nativeMessagingHost_.stopDaemon(callback, onError); | 300 this.nativeMessagingHost_.stopDaemon(onDone, onError); |
305 break; | 301 break; |
306 case remoting.HostDispatcher.State.NPAPI: | 302 case remoting.HostDispatcher.State.NPAPI: |
307 try { | 303 try { |
308 this.npapiHost_.stopDaemon(callback); | 304 this.npapiHost_.stopDaemon(onDone); |
309 } catch (err) { | 305 } catch (err) { |
310 onError(remoting.Error.MISSING_PLUGIN); | 306 onError(remoting.Error.MISSING_PLUGIN); |
311 } | 307 } |
312 break; | 308 break; |
313 } | 309 } |
314 }; | 310 }; |
315 | 311 |
316 /** | 312 /** |
317 * @param {function(remoting.HostController.State):void} callback | 313 * @param {function(remoting.HostController.State):void} onDone |
318 * @param {function(remoting.Error):void} onError | 314 * @param {function(remoting.Error):void} onError |
319 * @return {void} | 315 * @return {void} |
320 */ | 316 */ |
321 remoting.HostDispatcher.prototype.getDaemonState = function(callback, onError) { | 317 remoting.HostDispatcher.prototype.getDaemonState = function(onDone, onError) { |
322 switch (this.state_) { | 318 switch (this.state_) { |
323 case remoting.HostDispatcher.State.UNKNOWN: | 319 case remoting.HostDispatcher.State.UNKNOWN: |
324 this.pendingRequests_.push( | 320 this.pendingRequests_.push( |
325 this.getDaemonState.bind(this, callback, onError)); | 321 this.getDaemonState.bind(this, onDone, onError)); |
326 break; | 322 break; |
327 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 323 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
328 this.nativeMessagingHost_.getDaemonState(callback, onError); | 324 this.nativeMessagingHost_.getDaemonState(onDone, onError); |
329 break; | 325 break; |
330 case remoting.HostDispatcher.State.NPAPI: | 326 case remoting.HostDispatcher.State.NPAPI: |
331 // Call the callback directly, since NPAPI exposes the state directly as | 327 // Call the callback directly, since NPAPI exposes the state directly as |
332 // a field member, rather than an asynchronous method. | 328 // a field member, rather than an asynchronous method. |
333 var state = this.npapiHost_.daemonState; | 329 var state = this.npapiHost_.daemonState; |
334 if (state === undefined) { | 330 if (state === undefined) { |
335 onError(remoting.Error.MISSING_PLUGIN); | 331 onError(remoting.Error.MISSING_PLUGIN); |
336 } else { | 332 } else { |
337 callback(state); | 333 onDone(state); |
338 } | 334 } |
339 break; | 335 break; |
340 } | 336 } |
341 }; | 337 }; |
342 | 338 |
343 /** | 339 /** |
344 * @param {function(Array.<remoting.PairedClient>):void} callback | 340 * @param {function(Array.<remoting.PairedClient>):void} onDone |
345 * @param {function(remoting.Error):void} onError | 341 * @param {function(remoting.Error):void} onError |
346 * @return {void} | 342 * @return {void} |
347 */ | 343 */ |
348 remoting.HostDispatcher.prototype.getPairedClients = function(callback, | 344 remoting.HostDispatcher.prototype.getPairedClients = function(onDone, onError) { |
349 onError) { | |
350 /** | 345 /** |
351 * Converts the JSON string from the NPAPI plugin to Array.<PairedClient>, to | 346 * Converts the JSON string from the NPAPI plugin to Array.<PairedClient>, to |
352 * pass to |callback|. | 347 * pass to |onDone|. |
353 * @param {string} pairedClientsJson | 348 * @param {string} pairedClientsJson |
354 * @return {void} | 349 * @return {void} |
355 */ | 350 */ |
356 function callbackForNpapi(pairedClientsJson) { | 351 function callbackForNpapi(pairedClientsJson) { |
357 var pairedClients = remoting.PairedClient.convertToPairedClientArray( | 352 var pairedClients = remoting.PairedClient.convertToPairedClientArray( |
358 jsonParseSafe(pairedClientsJson)); | 353 jsonParseSafe(pairedClientsJson)); |
359 if (pairedClients != null) { | 354 if (pairedClients != null) { |
360 callback(pairedClients); | 355 onDone(pairedClients); |
361 } else { | 356 } else { |
362 onError(remoting.Error.UNEXPECTED); | 357 onError(remoting.Error.UNEXPECTED); |
363 } | 358 } |
364 } | 359 } |
365 | 360 |
366 switch (this.state_) { | 361 switch (this.state_) { |
367 case remoting.HostDispatcher.State.UNKNOWN: | 362 case remoting.HostDispatcher.State.UNKNOWN: |
368 this.pendingRequests_.push( | 363 this.pendingRequests_.push( |
369 this.getPairedClients.bind(this, callback, onError)); | 364 this.getPairedClients.bind(this, onDone, onError)); |
370 break; | 365 break; |
371 case remoting.HostDispatcher.State.NATIVE_MESSAGING: | 366 case remoting.HostDispatcher.State.NATIVE_MESSAGING: |
372 this.nativeMessagingHost_.getPairedClients(callback, onError); | 367 this.nativeMessagingHost_.getPairedClients(onDone, onError); |
373 break; | 368 break; |
374 case remoting.HostDispatcher.State.NPAPI: | 369 case remoting.HostDispatcher.State.NPAPI: |
375 try { | 370 try { |
376 this.npapiHost_.getPairedClients(callbackForNpapi); | 371 this.npapiHost_.getPairedClients(callbackForNpapi); |
377 } catch (err) { | 372 } catch (err) { |
378 onError(remoting.Error.MISSING_PLUGIN); | 373 onError(remoting.Error.MISSING_PLUGIN); |
379 } | 374 } |
380 break; | 375 break; |
381 } | 376 } |
382 }; | 377 }; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 break; | 419 break; |
425 case remoting.HostDispatcher.State.NPAPI: | 420 case remoting.HostDispatcher.State.NPAPI: |
426 try { | 421 try { |
427 this.npapiHost_.deletePairedClient(client, onDone); | 422 this.npapiHost_.deletePairedClient(client, onDone); |
428 } catch (err) { | 423 } catch (err) { |
429 onError(remoting.Error.MISSING_PLUGIN); | 424 onError(remoting.Error.MISSING_PLUGIN); |
430 } | 425 } |
431 break; | 426 break; |
432 } | 427 } |
433 }; | 428 }; |
OLD | NEW |