| 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 // WK Bug 55728 is fixed on the chrome 12 branch but not on the trunk. | 5 // WK Bug 55728 is fixed on the chrome 12 branch but not on the trunk. |
| 6 // TODO(rginda): Enable this everywhere once we have a trunk-worthy fix. | 6 // TODO(rginda): Enable this everywhere once we have a trunk-worthy fix. |
| 7 const ENABLE_METADATA = true; | 7 const ENABLE_METADATA = true; |
| 8 | 8 |
| 9 // Thumbnail view is painful without the exif reader. | 9 // Thumbnail view is painful without the exif reader. |
| 10 const ENABLE_THUMBNAIL_VIEW = ENABLE_METADATA; | 10 const ENABLE_THUMBNAIL_VIEW = ENABLE_METADATA; |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 * | 975 * |
| 976 * Invoked by cr.ui.Table when a file needs to be rendered. | 976 * Invoked by cr.ui.Table when a file needs to be rendered. |
| 977 * | 977 * |
| 978 * @param {Entry} entry The Entry object to render. | 978 * @param {Entry} entry The Entry object to render. |
| 979 * @param {string} columnId The id of the column to be rendered. | 979 * @param {string} columnId The id of the column to be rendered. |
| 980 * @param {cr.ui.Table} table The table doing the rendering. | 980 * @param {cr.ui.Table} table The table doing the rendering. |
| 981 */ | 981 */ |
| 982 FileManager.prototype.renderName_ = function(entry, columnId, table) { | 982 FileManager.prototype.renderName_ = function(entry, columnId, table) { |
| 983 var label = this.document_.createElement('div'); | 983 var label = this.document_.createElement('div'); |
| 984 label.entry = entry; | 984 label.entry = entry; |
| 985 label.className = 'filename-label'; | 985 label.className = 'detail-name filename-label'; |
| 986 if (this.currentDirEntry_.name == '') { | 986 if (this.currentDirEntry_.name == '') { |
| 987 label.textContent = this.getLabelForRootPath_(entry.name); | 987 label.textContent = this.getLabelForRootPath_(entry.name); |
| 988 } else { | 988 } else { |
| 989 label.textContent = entry.name; | 989 label.textContent = entry.name; |
| 990 } | 990 } |
| 991 | 991 |
| 992 return label; | 992 return label; |
| 993 }; | 993 }; |
| 994 | 994 |
| 995 /** | 995 /** |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1821 // Renaming only enabled for full-page mode, outside of the root | 1821 // Renaming only enabled for full-page mode, outside of the root |
| 1822 // directory. | 1822 // directory. |
| 1823 return false; | 1823 return false; |
| 1824 } | 1824 } |
| 1825 | 1825 |
| 1826 // Rename already in progress. | 1826 // Rename already in progress. |
| 1827 if (this.renameInput_.currentEntry) | 1827 if (this.renameInput_.currentEntry) |
| 1828 return false; | 1828 return false; |
| 1829 | 1829 |
| 1830 // Didn't click on the label. | 1830 // Didn't click on the label. |
| 1831 if (event.srcElement.className != 'filename-label') | 1831 if (!event.srcElement.classList.contains('filename-label')) |
| 1832 return false; | 1832 return false; |
| 1833 | 1833 |
| 1834 // Wrong button or using a keyboard modifier. | 1834 // Wrong button or using a keyboard modifier. |
| 1835 if (event.button != 0 || event.shiftKey || event.metaKey || event.altKey) { | 1835 if (event.button != 0 || event.shiftKey || event.metaKey || event.altKey) { |
| 1836 this.lastLabelClick_ = null; | 1836 this.lastLabelClick_ = null; |
| 1837 return false; | 1837 return false; |
| 1838 } | 1838 } |
| 1839 | 1839 |
| 1840 var now = new Date(); | 1840 var now = new Date(); |
| 1841 var path = event.srcElement.entry.fullPath; | 1841 var path = event.srcElement.entry.fullPath; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) { | 2136 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) { |
| 2137 if (!this.selection.leadEntry.isFile) | 2137 if (!this.selection.leadEntry.isFile) |
| 2138 throw new Error('Selected entry is not a file!'); | 2138 throw new Error('Selected entry is not a file!'); |
| 2139 } | 2139 } |
| 2140 | 2140 |
| 2141 chrome.fileBrowserPrivate.selectFile(ary[0], 0); | 2141 chrome.fileBrowserPrivate.selectFile(ary[0], 0); |
| 2142 window.close(); | 2142 window.close(); |
| 2143 }; | 2143 }; |
| 2144 | 2144 |
| 2145 })(); | 2145 })(); |
| OLD | NEW |