OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 6 /** |
7 * DefaultActionDialog contains a message, a list box, an ok button, and a | 7 * DefaultActionDialog contains a message, a list box, an ok button, and a |
8 * cancel button. | 8 * cancel button. |
9 * This dialog should be used as action picker for file operations. | 9 * This dialog should be used as action picker for file operations. |
10 */ | 10 */ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 cr.defineProperty(result, 'selected', cr.PropertyKind.BOOL_ATTR); | 76 cr.defineProperty(result, 'selected', cr.PropertyKind.BOOL_ATTR); |
77 | 77 |
78 return result; | 78 return result; |
79 }; | 79 }; |
80 | 80 |
81 /** | 81 /** |
82 * Shows dialog. | 82 * Shows dialog. |
83 * | 83 * |
84 * @param {string} title Title in dialog caption. | 84 * @param {string} title Title in dialog caption. |
85 * @param {string} message Message in dialog caption. | 85 * @param {string} message Message in dialog caption. |
86 * @param {Array} items Items to render in list | 86 * @param {Array} items Items to render in list. |
87 * @param {int} defaultIndex Item to select by default. | 87 * @param {int} defaultIndex Item to select by default. |
88 * @param {Function} onOk Callback function. | 88 * @param {Function} onOk Callback function. |
89 * @param {Function} onCancel Callback function. | 89 * @param {Function} onCancel Callback function. |
90 * @param {Function} onShow Callback function. | 90 * @param {Function} onShow Callback function. |
91 */ | 91 */ |
92 DefaultActionDialog.prototype.show = function(title, message, items, | 92 DefaultActionDialog.prototype.show = function(title, message, items, |
93 defaultIndex, onOk, onCancel, onShow) { | 93 defaultIndex, onOk, onCancel, onShow) { |
94 | 94 |
95 cr.ui.dialogs.BaseDialog.prototype.showWithTitle.apply(this, | 95 cr.ui.dialogs.BaseDialog.prototype.showWithTitle.apply(this, |
96 [title, message, onOk, onCancel, onShow]); | 96 [title, message, onOk, onCancel, onShow]); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 this.onCancelClick_(event); | 139 this.onCancelClick_(event); |
140 event.preventDefault(); | 140 event.preventDefault(); |
141 } else if (event.keyCode == 32 || event.keyCode == 13) { | 141 } else if (event.keyCode == 32 || event.keyCode == 13) { |
142 this.onOkClick_(); | 142 this.onOkClick_(); |
143 event.preventDefault(); | 143 event.preventDefault(); |
144 } | 144 } |
145 }; | 145 }; |
146 | 146 |
147 return {DefaultActionDialog: DefaultActionDialog}; | 147 return {DefaultActionDialog: DefaultActionDialog}; |
148 }); | 148 }); |
OLD | NEW |