Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 var g_slideshow_data = null; | 10 var g_slideshow_data = null; |
| (...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1672 }; | 1672 }; |
| 1673 | 1673 |
| 1674 /** | 1674 /** |
| 1675 * Checks whether unmount task should be displayed and if the answer is | 1675 * Checks whether unmount task should be displayed and if the answer is |
| 1676 * affirmative renders it. | 1676 * affirmative renders it. |
| 1677 * @param {Object} selection Selected files object. | 1677 * @param {Object} selection Selected files object. |
| 1678 */ | 1678 */ |
| 1679 FileManager.prototype.maybeRenderUnmountTask_ = function(selection) { | 1679 FileManager.prototype.maybeRenderUnmountTask_ = function(selection) { |
| 1680 for (var index = 0; index < selection.urls.length; ++index) { | 1680 for (var index = 0; index < selection.urls.length; ++index) { |
| 1681 // Each url should be a mount point. | 1681 // Each url should be a mount point. |
| 1682 var path = selection.urls[index]; | 1682 var path = selection.entries[index].fullPath; |
| 1683 if (!this.mountPoints_.hasOwnProperty(path) || | 1683 var found = false; |
| 1684 this.mountPoints_[path].type != 'file') | 1684 for (var i = 0; i < this.mountPoints_.length; i++) { |
| 1685 var mountPath = this.mountPoints_[i].mountPath; | |
| 1686 if (mountPath[0] != '/') { | |
|
rginda
2011/08/23 21:09:03
FYI, in http://codereview.chromium.org/7706028/ Sz
| |
| 1687 mountPath = '/' + mountPath; | |
| 1688 } | |
| 1689 if (mountPath == path && this.mountPoints_[i].mountType == 'file') { | |
| 1690 found = true; | |
| 1691 break; | |
| 1692 } | |
| 1693 } | |
| 1694 if (!found) | |
| 1685 return; | 1695 return; |
| 1686 } | 1696 } |
| 1687 this.renderTaskButton_({ | 1697 this.renderTaskButton_({ |
| 1688 taskId: this.getExtensionId_() + '|unmount-archive', | 1698 taskId: this.getExtensionId_() + '|unmount-archive', |
| 1689 iconUrl: | 1699 iconUrl: |
| 1690 chrome.extension.getURL('images/icon_unmount_archive_16x16.png'), | 1700 chrome.extension.getURL('images/icon_unmount_archive_16x16.png'), |
| 1691 title: str('UNMOUNT_ARCHIVE') | 1701 title: str('UNMOUNT_ARCHIVE') |
| 1692 }); | 1702 }); |
| 1693 }; | 1703 }; |
| 1694 | 1704 |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3147 | 3157 |
| 3148 if (msg) { | 3158 if (msg) { |
| 3149 console.log('no no no'); | 3159 console.log('no no no'); |
| 3150 this.alert.show(msg, onAccept); | 3160 this.alert.show(msg, onAccept); |
| 3151 return false; | 3161 return false; |
| 3152 } | 3162 } |
| 3153 | 3163 |
| 3154 return true; | 3164 return true; |
| 3155 }; | 3165 }; |
| 3156 })(); | 3166 })(); |
| OLD | NEW |