Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 9019002: [CrosDisksClient] Determine device type from DeviceMediaType property sent by cros-disks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: little error in imageburner Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698