| 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 // Setting the src of an img to an empty string can crash the browser, so we | 5 // Setting the src of an img to an empty string can crash the browser, so we |
| 6 // use an empty 1x1 gif instead. | 6 // use an empty 1x1 gif instead. |
| 7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,' | 7 const EMPTY_IMAGE_URI = 'data:image/gif;base64,' |
| 8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D'; | 8 + 'R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D'; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2104 */ | 2104 */ |
| 2105 FileManager.prototype.maybeRenderFormattingTask_ = function(selection) { | 2105 FileManager.prototype.maybeRenderFormattingTask_ = function(selection) { |
| 2106 // Not to make unnecessary getMountPoints() call we doublecheck if there is | 2106 // Not to make unnecessary getMountPoints() call we doublecheck if there is |
| 2107 // only one selected entry. | 2107 // only one selected entry. |
| 2108 if (selection.entries.length != 1) | 2108 if (selection.entries.length != 1) |
| 2109 return; | 2109 return; |
| 2110 var self = this; | 2110 var self = this; |
| 2111 function onMountPointsFound(mountPoints) { | 2111 function onMountPointsFound(mountPoints) { |
| 2112 self.mountPoints_ = mountPoints; | 2112 self.mountPoints_ = mountPoints; |
| 2113 function onVolumeMetadataFound(volumeMetadata) { | 2113 function onVolumeMetadataFound(volumeMetadata) { |
| 2114 if (volumeMetadata.deviceType == "flash") { | 2114 if (volumeMetadata.deviceType == "usb" || |
| 2115 volumeMetadata.deviceType == "sd") { |
| 2115 if (self.selection.entries.length != 1 || | 2116 if (self.selection.entries.length != 1 || |
| 2116 normalizeAbsolutePath(self.selection.entries[0].fullPath) != | 2117 normalizeAbsolutePath(self.selection.entries[0].fullPath) != |
| 2117 normalizeAbsolutePath(volumeMetadata.mountPath)) { | 2118 normalizeAbsolutePath(volumeMetadata.mountPath)) { |
| 2118 return; | 2119 return; |
| 2119 } | 2120 } |
| 2120 var task = { | 2121 var task = { |
| 2121 taskId: self.getExtensionId_() + '|format-device', | 2122 taskId: self.getExtensionId_() + '|format-device', |
| 2122 iconUrl: chrome.extension.getURL('images/filetype_generic.png'), | 2123 iconUrl: chrome.extension.getURL('images/filetype_generic.png'), |
| 2123 title: str('FORMAT_DEVICE'), | 2124 title: str('FORMAT_DEVICE'), |
| 2124 internal: true | 2125 internal: true |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3657 }); | 3658 }); |
| 3658 }, onError); | 3659 }, onError); |
| 3659 | 3660 |
| 3660 function onError(err) { | 3661 function onError(err) { |
| 3661 console.log('Error while checking free space: ' + err); | 3662 console.log('Error while checking free space: ' + err); |
| 3662 setTimeout(doCheck, 1000 * 60); | 3663 setTimeout(doCheck, 1000 * 60); |
| 3663 } | 3664 } |
| 3664 } | 3665 } |
| 3665 } | 3666 } |
| 3666 })(); | 3667 })(); |
| OLD | NEW |