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 * Manage the installation of apps. | 6 * Manage the installation of apps. |
7 * | 7 * |
8 * @param {string} itemId Item id to be installed. | 8 * @param {string} itemId Item id to be installed. |
9 * @param {!CWSWidgetContainer.PlatformDelegate} delegate Delegate for accessing | 9 * @param {!CWSWidgetContainerPlatformDelegate} delegate Delegate for accessing |
10 * Chrome platform APIs. | 10 * Chrome platform APIs. |
11 * @constructor | 11 * @constructor |
12 * @struct | 12 * @struct |
13 */ | 13 */ |
14 function AppInstaller(itemId, delegate) { | 14 function AppInstaller(itemId, delegate) { |
15 /** @private {!CWSWidgetContainer.PlatformDelegate} */ | 15 /** @private {!CWSWidgetContainerPlatformDelegate} */ |
16 this.delegate_ = delegate; | 16 this.delegate_ = delegate; |
17 this.itemId_ = itemId; | 17 this.itemId_ = itemId; |
18 this.callback_ = null; | 18 this.callback_ = null; |
19 } | 19 } |
20 | 20 |
21 /** | 21 /** |
22 * Type of result. | 22 * Type of result. |
23 * | 23 * |
24 * @enum {string} | 24 * @enum {string} |
25 * @const | 25 * @const |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 var installerResult = AppInstaller.Result.SUCCESS; | 75 var installerResult = AppInstaller.Result.SUCCESS; |
76 if (error !== null) { | 76 if (error !== null) { |
77 installerResult = | 77 installerResult = |
78 error == AppInstaller.USER_CANCELLED_ERROR_STR_ ? | 78 error == AppInstaller.USER_CANCELLED_ERROR_STR_ ? |
79 AppInstaller.Result.CANCELLED : | 79 AppInstaller.Result.CANCELLED : |
80 AppInstaller.Result.ERROR; | 80 AppInstaller.Result.ERROR; |
81 } | 81 } |
82 this.callback_(installerResult, error || ''); | 82 this.callback_(installerResult, error || ''); |
83 this.callback_ = null; | 83 this.callback_ = null; |
84 }; | 84 }; |
OLD | NEW |