| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * This variable is checked in SelectFileDialogExtensionBrowserTest. | 8 * This variable is checked in SelectFileDialogExtensionBrowserTest. |
| 9 * @type {number} | 9 * @type {number} |
| 10 */ | 10 */ |
| (...skipping 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 return; | 2348 return; |
| 2349 } | 2349 } |
| 2350 | 2350 |
| 2351 this.openSuggestAppsDialog_(urls, | 2351 this.openSuggestAppsDialog_(urls, |
| 2352 // Success callback. | 2352 // Success callback. |
| 2353 function() { | 2353 function() { |
| 2354 var tasks = new FileTasks(this); | 2354 var tasks = new FileTasks(this); |
| 2355 tasks.init(urls, mimeTypes); | 2355 tasks.init(urls, mimeTypes); |
| 2356 tasks.executeDefault(); | 2356 tasks.executeDefault(); |
| 2357 }.bind(this), | 2357 }.bind(this), |
| 2358 // Cancelled callback. |
| 2359 function() {}, |
| 2358 // Failure callback. | 2360 // Failure callback. |
| 2359 function() {}, | |
| 2360 // Cancelled callback. | |
| 2361 showAlert); | 2361 showAlert); |
| 2362 }.bind(this)); | 2362 }.bind(this)); |
| 2363 } | 2363 } |
| 2364 return true; | 2364 return true; |
| 2365 } | 2365 } |
| 2366 if (!this.okButton_.disabled) { | 2366 if (!this.okButton_.disabled) { |
| 2367 this.onOk_(); | 2367 this.onOk_(); |
| 2368 return true; | 2368 return true; |
| 2369 } | 2369 } |
| 2370 return false; | 2370 return false; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2390 if (!props || !props[0] || !props[0].contentMimeType) { | 2390 if (!props || !props[0] || !props[0].contentMimeType) { |
| 2391 onFailure(); | 2391 onFailure(); |
| 2392 return; | 2392 return; |
| 2393 } | 2393 } |
| 2394 | 2394 |
| 2395 var filename = util.extractFilePath(urls[0]); | 2395 var filename = util.extractFilePath(urls[0]); |
| 2396 var extension = PathUtil.extractExtension(filename); | 2396 var extension = PathUtil.extractExtension(filename); |
| 2397 var mime = props[0].contentMimeType; | 2397 var mime = props[0].contentMimeType; |
| 2398 this.suggestAppsDialog.show( | 2398 this.suggestAppsDialog.show( |
| 2399 extension, mime, | 2399 extension, mime, |
| 2400 function(installed) { | 2400 function(result) { |
| 2401 if (installed) | 2401 switch (result) { |
| 2402 onSuccess(); | 2402 case SuggestAppsDialog.Result.INSTALL_SUCCESSFUL: |
| 2403 else | 2403 onSuccess(); |
| 2404 onCancelled(); | 2404 break; |
| 2405 case SuggestAppsDialog.Result.FAILED: |
| 2406 onFailure(); |
| 2407 break; |
| 2408 default: |
| 2409 onCancelled(); |
| 2410 } |
| 2405 }); | 2411 }); |
| 2406 }.bind(this)); | 2412 }.bind(this)); |
| 2407 }; | 2413 }; |
| 2408 | 2414 |
| 2409 /** | 2415 /** |
| 2410 * Executes directory action (i.e. changes directory). | 2416 * Executes directory action (i.e. changes directory). |
| 2411 * | 2417 * |
| 2412 * @param {DirectoryEntry} entry Directory entry to which directory should be | 2418 * @param {DirectoryEntry} entry Directory entry to which directory should be |
| 2413 * changed. | 2419 * changed. |
| 2414 */ | 2420 */ |
| (...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3987 */ | 3993 */ |
| 3988 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3994 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
| 3989 this.ctrlKeyPressed_ = flag; | 3995 this.ctrlKeyPressed_ = flag; |
| 3990 // Before the DOM is constructed, the key event can be handled. | 3996 // Before the DOM is constructed, the key event can be handled. |
| 3991 var cacheClearCommand = | 3997 var cacheClearCommand = |
| 3992 this.document_.querySelector('#drive-clear-local-cache'); | 3998 this.document_.querySelector('#drive-clear-local-cache'); |
| 3993 if (cacheClearCommand) | 3999 if (cacheClearCommand) |
| 3994 cacheClearCommand.canExecuteChange(); | 4000 cacheClearCommand.canExecuteChange(); |
| 3995 }; | 4001 }; |
| 3996 })(); | 4002 })(); |
| OLD | NEW |