| 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 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2150 */ | 2150 */ |
| 2151 FileManager.prototype.maybeRenderFormattingTask_ = function(selection) { | 2151 FileManager.prototype.maybeRenderFormattingTask_ = function(selection) { |
| 2152 // Not to make unnecessary getMountPoints() call we doublecheck if there is | 2152 // Not to make unnecessary getMountPoints() call we doublecheck if there is |
| 2153 // only one selected entry. | 2153 // only one selected entry. |
| 2154 if (selection.entries.length != 1) | 2154 if (selection.entries.length != 1) |
| 2155 return; | 2155 return; |
| 2156 var self = this; | 2156 var self = this; |
| 2157 function onMountPointsFound(mountPoints) { | 2157 function onMountPointsFound(mountPoints) { |
| 2158 self.mountPoints_ = mountPoints; | 2158 self.mountPoints_ = mountPoints; |
| 2159 function onVolumeMetadataFound(volumeMetadata) { | 2159 function onVolumeMetadataFound(volumeMetadata) { |
| 2160 if (volumeMetadata.deviceType == "flash") { | 2160 if (volumeMetadata.deviceType == "usb" || |
| 2161 volumeMetadata.deviceType == "sd") { |
| 2161 if (self.selection.entries.length != 1 || | 2162 if (self.selection.entries.length != 1 || |
| 2162 normalizeAbsolutePath(self.selection.entries[0].fullPath) != | 2163 normalizeAbsolutePath(self.selection.entries[0].fullPath) != |
| 2163 normalizeAbsolutePath(volumeMetadata.mountPath)) { | 2164 normalizeAbsolutePath(volumeMetadata.mountPath)) { |
| 2164 return; | 2165 return; |
| 2165 } | 2166 } |
| 2166 var task = { | 2167 var task = { |
| 2167 taskId: self.getExtensionId_() + '|format-device', | 2168 taskId: self.getExtensionId_() + '|format-device', |
| 2168 iconUrl: chrome.extension.getURL('images/filetype_generic.png'), | 2169 iconUrl: chrome.extension.getURL('images/filetype_generic.png'), |
| 2169 title: str('FORMAT_DEVICE'), | 2170 title: str('FORMAT_DEVICE'), |
| 2170 internal: true | 2171 internal: true |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3684 }); | 3685 }); |
| 3685 }, onError); | 3686 }, onError); |
| 3686 | 3687 |
| 3687 function onError(err) { | 3688 function onError(err) { |
| 3688 console.log('Error while checking free space: ' + err); | 3689 console.log('Error while checking free space: ' + err); |
| 3689 setTimeout(doCheck, 1000 * 60); | 3690 setTimeout(doCheck, 1000 * 60); |
| 3690 } | 3691 } |
| 3691 } | 3692 } |
| 3692 } | 3693 } |
| 3693 })(); | 3694 })(); |
| OLD | NEW |