| 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 * @param {WebView} webView Web View tag. | 6 * @param {WebView} webView Web View tag. |
| 7 * @param {number} width Width of the CWS widget. | 7 * @param {number} width Width of the CWS widget. |
| 8 * @param {number} height Height of the CWS widget. | 8 * @param {number} height Height of the CWS widget. |
| 9 * @param {string} url Share Url for an entry. | 9 * @param {string} url Share Url for an entry. |
| 10 * @param {string} target Target (scheme + host + port) of the widget. | 10 * @param {string} target Target (scheme + host + port) of the widget. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 /** | 196 /** |
| 197 * Send the 'initialize' message to the widget. | 197 * Send the 'initialize' message to the widget. |
| 198 * @private | 198 * @private |
| 199 */ | 199 */ |
| 200 CWSContainerClient.prototype.postInitializeMessage_ = function() { | 200 CWSContainerClient.prototype.postInitializeMessage_ = function() { |
| 201 new Promise(function(fulfill, reject) { | 201 new Promise(function(fulfill, reject) { |
| 202 this.delegate_.getInstalledItems( | 202 this.delegate_.getInstalledItems( |
| 203 /** | 203 /** |
| 204 * @param {?Array.<!string>} items Installed items. | 204 * @param {?Array<!string>} items Installed items. |
| 205 * Null on error. | 205 * Null on error. |
| 206 */ | 206 */ |
| 207 function(items) { | 207 function(items) { |
| 208 if (!items) { | 208 if (!items) { |
| 209 reject('Failed to retrive installed items.'); | 209 reject('Failed to retrive installed items.'); |
| 210 return; | 210 return; |
| 211 } | 211 } |
| 212 fulfill(items); | 212 fulfill(items); |
| 213 }) | 213 }) |
| 214 }.bind(this)).then( | 214 }.bind(this)).then( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 'loadabort', this.onLoadAbortBound_); | 274 'loadabort', this.onLoadAbortBound_); |
| 275 this.webView_.stop(); | 275 this.webView_.stop(); |
| 276 }; | 276 }; |
| 277 | 277 |
| 278 /** | 278 /** |
| 279 * Cleans the dialog by removing all handlers. | 279 * Cleans the dialog by removing all handlers. |
| 280 */ | 280 */ |
| 281 CWSContainerClient.prototype.dispose = function() { | 281 CWSContainerClient.prototype.dispose = function() { |
| 282 this.abort(); | 282 this.abort(); |
| 283 }; | 283 }; |
| OLD | NEW |