| 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_EXIF_READER = navigator.userAgent.match(/chrome\/12\.0/i); | 7 const ENABLE_EXIF_READER = navigator.userAgent.match(/chrome\/12\.0/i); |
| 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_EXIF_READER; | 10 const ENABLE_THUMBNAIL_VIEW = ENABLE_EXIF_READER; |
| (...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 * Handle a double-click event on an entry in the detail list. | 1615 * Handle a double-click event on an entry in the detail list. |
| 1616 * | 1616 * |
| 1617 * @param {Event} event The click event. | 1617 * @param {Event} event The click event. |
| 1618 */ | 1618 */ |
| 1619 FileManager.prototype.onDetailDoubleClick_ = function(event) { | 1619 FileManager.prototype.onDetailDoubleClick_ = function(event) { |
| 1620 if (this.renameInput_.currentEntry) { | 1620 if (this.renameInput_.currentEntry) { |
| 1621 // Don't pay attention to double clicks during a rename. | 1621 // Don't pay attention to double clicks during a rename. |
| 1622 return; | 1622 return; |
| 1623 } | 1623 } |
| 1624 | 1624 |
| 1625 var i = this.currentList_.selectionModel.leadIndex; | 1625 var entry = this.selection.leadEntry; |
| 1626 var entry = this.dataModel_.item(i); | 1626 if (!entry) { |
| 1627 console.log('Invalid selection'); |
| 1628 return; |
| 1629 } |
| 1627 | 1630 |
| 1628 if (entry.isDirectory) | 1631 if (entry.isDirectory) |
| 1629 return this.changeDirectory(entry.fullPath); | 1632 return this.changeDirectory(entry.fullPath); |
| 1630 | 1633 |
| 1631 if (!this.okButton_.disabled) | 1634 if (!this.okButton_.disabled) |
| 1632 this.onOk_(); | 1635 this.onOk_(); |
| 1633 | 1636 |
| 1634 }; | 1637 }; |
| 1635 | 1638 |
| 1636 /** | 1639 /** |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) { | 2110 } else if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE) { |
| 2108 if (!this.selection.leadEntry.isFile) | 2111 if (!this.selection.leadEntry.isFile) |
| 2109 throw new Error('Selected entry is not a file!'); | 2112 throw new Error('Selected entry is not a file!'); |
| 2110 } | 2113 } |
| 2111 | 2114 |
| 2112 chrome.fileBrowserPrivate.selectFile(ary[0], 0); | 2115 chrome.fileBrowserPrivate.selectFile(ary[0], 0); |
| 2113 window.close(); | 2116 window.close(); |
| 2114 }; | 2117 }; |
| 2115 | 2118 |
| 2116 })(); | 2119 })(); |
| OLD | NEW |