OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * Interface abstracting the Application functionality. | 7 * Interface abstracting the Application functionality. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 }; | 107 }; |
108 | 108 |
109 /** | 109 /** |
110 * Called when an extension message needs to be handled. | 110 * Called when an extension message needs to be handled. |
111 * | 111 * |
112 * @param {string} type The type of the extension message. | 112 * @param {string} type The type of the extension message. |
113 * @param {string} data The payload of the extension message. | 113 * @param {string} data The payload of the extension message. |
114 * @return {boolean} Return true if the extension message was recognized. | 114 * @return {boolean} Return true if the extension message was recognized. |
115 */ | 115 */ |
116 remoting.Application.prototype.onExtensionMessage = function(type, data) { | 116 remoting.Application.prototype.onExtensionMessage = function(type, data) { |
117 var message = /** @type {Object} */base.jsonParseSafe(data); | 117 var message = /** @type {Object} */ (base.jsonParseSafe(data)); |
118 if (typeof message != 'object') { | 118 if (typeof message != 'object') { |
119 return false; | 119 return false; |
120 } | 120 } |
121 | 121 |
122 // Give the delegate a chance to handle this extension message first. | 122 // Give the delegate a chance to handle this extension message first. |
123 if (this.delegate_.handleExtensionMessage(type, message)) { | 123 if (this.delegate_.handleExtensionMessage(type, message)) { |
124 return true; | 124 return true; |
125 } | 125 } |
126 | 126 |
127 if (remoting.clientSession) { | 127 if (remoting.clientSession) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 * Called when an error needs to be displayed to the user. | 234 * Called when an error needs to be displayed to the user. |
235 * | 235 * |
236 * @param {remoting.Error} errorTag The error to be localized and displayed. | 236 * @param {remoting.Error} errorTag The error to be localized and displayed. |
237 * @return {void} Nothing. | 237 * @return {void} Nothing. |
238 */ | 238 */ |
239 remoting.Application.Delegate.prototype.handleError = function(errorTag) {}; | 239 remoting.Application.Delegate.prototype.handleError = function(errorTag) {}; |
240 | 240 |
241 | 241 |
242 /** @type {remoting.Application} */ | 242 /** @type {remoting.Application} */ |
243 remoting.app = null; | 243 remoting.app = null; |
OLD | NEW |