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 // This variable is checked in SelectFileDialogExtensionBrowserTest. | 5 // This variable is checked in SelectFileDialogExtensionBrowserTest. |
6 var JSErrorCount = 0; | 6 var JSErrorCount = 0; |
7 | 7 |
8 /** | 8 /** |
9 * Count uncaught exceptions. | 9 * Count uncaught exceptions. |
10 */ | 10 */ |
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 var handleClick = function() { | 1405 var handleClick = function() { |
1406 if (li.selected && path !== dm.getCurrentDirPath()) { | 1406 if (li.selected && path !== dm.getCurrentDirPath()) { |
1407 dm.changeDirectory(path); | 1407 dm.changeDirectory(path); |
1408 } | 1408 } |
1409 }; | 1409 }; |
1410 li.addEventListener('mousedown', handleClick); | 1410 li.addEventListener('mousedown', handleClick); |
1411 li.addEventListener(cr.ui.TouchHandler.EventType.TOUCH_START, handleClick); | 1411 li.addEventListener(cr.ui.TouchHandler.EventType.TOUCH_START, handleClick); |
1412 | 1412 |
1413 var rootType = PathUtil.getRootType(path); | 1413 var rootType = PathUtil.getRootType(path); |
1414 | 1414 |
| 1415 var iconDiv = this.document_.createElement('div'); |
| 1416 iconDiv.className = 'volume-icon'; |
| 1417 iconDiv.setAttribute('volume-type-icon', rootType); |
| 1418 if (rootType === RootType.REMOVABLE) { |
| 1419 iconDiv.setAttribute('volume-subtype', |
| 1420 this.volumeManager_.getDeviceType(path)); |
| 1421 } |
| 1422 li.appendChild(iconDiv); |
| 1423 |
1415 var div = this.document_.createElement('div'); | 1424 var div = this.document_.createElement('div'); |
1416 div.className = 'root-label'; | 1425 div.className = 'root-label'; |
1417 | 1426 |
1418 div.setAttribute('volume-type-icon', rootType); | |
1419 if (rootType === RootType.REMOVABLE) | |
1420 div.setAttribute('volume-subtype', | |
1421 this.volumeManager_.getDeviceType(path)); | |
1422 | |
1423 div.textContent = PathUtil.getRootLabel(path); | 1427 div.textContent = PathUtil.getRootLabel(path); |
1424 li.appendChild(div); | 1428 li.appendChild(div); |
1425 | 1429 |
1426 if (rootType === RootType.ARCHIVE || rootType === RootType.REMOVABLE) { | 1430 if (rootType === RootType.ARCHIVE || rootType === RootType.REMOVABLE) { |
1427 var eject = this.document_.createElement('div'); | 1431 var eject = this.document_.createElement('div'); |
1428 eject.className = 'root-eject'; | 1432 eject.className = 'root-eject'; |
1429 eject.addEventListener('click', function(event) { | 1433 eject.addEventListener('click', function(event) { |
1430 event.stopPropagation(); | 1434 event.stopPropagation(); |
1431 var unmountCommand = this.dialogDom_.querySelector('command#unmount'); | 1435 var unmountCommand = this.dialogDom_.querySelector('command#unmount'); |
1432 // Let's make sure 'canExecute' state of the command is properly set for | 1436 // Let's make sure 'canExecute' state of the command is properly set for |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2950 return this.directoryModel_.getFileList(); | 2954 return this.directoryModel_.getFileList(); |
2951 }; | 2955 }; |
2952 | 2956 |
2953 /** | 2957 /** |
2954 * @return {cr.ui.List} Current list object. | 2958 * @return {cr.ui.List} Current list object. |
2955 */ | 2959 */ |
2956 FileManager.prototype.getCurrentList = function() { | 2960 FileManager.prototype.getCurrentList = function() { |
2957 return this.currentList_; | 2961 return this.currentList_; |
2958 }; | 2962 }; |
2959 })(); | 2963 })(); |
OLD | NEW |