OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 * SuggestAppsDialog contains a list box to select an app to be opened the file | 6 * SuggestAppsDialog contains a list box to select an app to be opened the file |
7 * with. This dialog should be used as action picker for file operations. | 7 * with. This dialog should be used as action picker for file operations. |
8 */ | 8 */ |
9 | 9 |
10 /** | 10 /** |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 * false otherwise. | 183 * false otherwise. |
184 */ | 184 */ |
185 SuggestAppsDialog.prototype.showByExtensionAndMime = | 185 SuggestAppsDialog.prototype.showByExtensionAndMime = |
186 function(extension, mime, onDialogClosed) { | 186 function(extension, mime, onDialogClosed) { |
187 this.text_.hidden = true; | 187 this.text_.hidden = true; |
188 this.dialogText_ = ''; | 188 this.dialogText_ = ''; |
189 this.showInternal_(null, extension, mime, onDialogClosed); | 189 this.showInternal_(null, extension, mime, onDialogClosed); |
190 }; | 190 }; |
191 | 191 |
192 /** | 192 /** |
193 * Shows suggest-apps dialog by the filename. | |
194 * | |
195 * @param {string} filename Filename (without extension) of the file. | |
196 * @param {function(boolean)} onDialogClosed Called when the dialog is closed. | |
197 * The argument is the result of installation: true if an app is installed, | |
198 * false otherwise. | |
199 */ | |
200 SuggestAppsDialog.prototype.showByFilename = | |
201 function(filename, onDialogClosed) { | |
202 this.text_.hidden = false; | |
203 this.dialogText_ = str('SUGGEST_DIALOG_MESSAGE_FOR_EXECUTABLE'); | |
204 this.showInternal_(filename, null, null, onDialogClosed); | |
205 }; | |
206 | |
207 /** | |
208 * Internal method to show a dialog. This should be called only from 'Suggest. | 193 * Internal method to show a dialog. This should be called only from 'Suggest. |
209 * appDialog.showXxxx()' functions. | 194 * appDialog.showXxxx()' functions. |
210 * | 195 * |
211 * @param {?string} filename Filename (without extension) of the file. | 196 * @param {?string} filename Filename (without extension) of the file. |
212 * @param {?string} extension Extension of the file. | 197 * @param {?string} extension Extension of the file. |
213 * @param {?string} mime Mime of the file. | 198 * @param {?string} mime Mime of the file. |
214 * @param {function(boolean)} onDialogClosed Called when the dialog is closed. | 199 * @param {function(boolean)} onDialogClosed Called when the dialog is closed. |
215 * The argument is the result of installation: true if an app is installed, | 200 * The argument is the result of installation: true if an app is installed, |
216 * false otherwise. | 201 * false otherwise. |
217 * @private | 202 * @private |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 metrics.recordUserAction('SuggestApps.ShowDialog'); | 543 metrics.recordUserAction('SuggestApps.ShowDialog'); |
559 }; | 544 }; |
560 | 545 |
561 SuggestAppsDialog.Metrics.startLoad = function() { | 546 SuggestAppsDialog.Metrics.startLoad = function() { |
562 metrics.startInterval('SuggestApps.LoadTime'); | 547 metrics.startInterval('SuggestApps.LoadTime'); |
563 }; | 548 }; |
564 | 549 |
565 SuggestAppsDialog.Metrics.finishLoad = function() { | 550 SuggestAppsDialog.Metrics.finishLoad = function() { |
566 metrics.recordInterval('SuggestApps.LoadTime'); | 551 metrics.recordInterval('SuggestApps.LoadTime'); |
567 }; | 552 }; |
OLD | NEW |