| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A volume list model. This model combines the 2 lists. | 8 * A volume list model. This model combines the 2 lists. |
| 9 * @param {cr.ui.ArrayDataModel} volumesList The first list of the model. | 9 * @param {cr.ui.ArrayDataModel} volumesList The first list of the model. |
| 10 * @param {cr.ui.ArrayDataModel} pinnedList The second list of the model. | 10 * @param {cr.ui.ArrayDataModel} pinnedList The second list of the model. |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 item.addEventListener('click', handleClick); | 304 item.addEventListener('click', handleClick); |
| 305 | 305 |
| 306 var handleEject = function() { | 306 var handleEject = function() { |
| 307 var unmountCommand = cr.doc.querySelector('command#unmount'); | 307 var unmountCommand = cr.doc.querySelector('command#unmount'); |
| 308 // Let's make sure 'canExecute' state of the command is properly set for | 308 // Let's make sure 'canExecute' state of the command is properly set for |
| 309 // the root before executing it. | 309 // the root before executing it. |
| 310 unmountCommand.canExecuteChange(item); | 310 unmountCommand.canExecuteChange(item); |
| 311 unmountCommand.execute(item); | 311 unmountCommand.execute(item); |
| 312 }; | 312 }; |
| 313 item.addEventListener('eject', handleEject); | 313 item.addEventListener('eject', handleEject); |
| 314 // TODO(yoshiki): Check if the following touch handler is necessary or not. | |
| 315 // If unnecessary, remove it. | |
| 316 item.addEventListener(cr.ui.TouchHandler.EventType.TOUCH_START, handleClick); | |
| 317 | 314 |
| 318 if (this.contextMenu_) | 315 if (this.contextMenu_) |
| 319 item.maybeSetContextMenu(this.contextMenu_); | 316 item.maybeSetContextMenu(this.contextMenu_); |
| 320 | 317 |
| 321 // If the current directory is already set. | 318 // If the current directory is already set. |
| 322 if (this.currentVolume_ == path) { | 319 if (this.currentVolume_ == path) { |
| 323 setTimeout(function() { | 320 setTimeout(function() { |
| 324 this.selectedItem = path; | 321 this.selectedItem = path; |
| 325 }.bind(this), 0); | 322 }.bind(this), 0); |
| 326 } | 323 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 var itemPath = this.dataModel.item(i); | 420 var itemPath = this.dataModel.item(i); |
| 424 if (PathUtil.getRootPath(itemPath) == newRootPath) { | 421 if (PathUtil.getRootPath(itemPath) == newRootPath) { |
| 425 // Not to invoke the handler of this instance, sets the guard. | 422 // Not to invoke the handler of this instance, sets the guard. |
| 426 this.dontHandleSelectionEvent_ = true; | 423 this.dontHandleSelectionEvent_ = true; |
| 427 this.selectionModel.selectedIndex = i; | 424 this.selectionModel.selectedIndex = i; |
| 428 this.dontHandleSelectionEvent_ = false; | 425 this.dontHandleSelectionEvent_ = false; |
| 429 return; | 426 return; |
| 430 } | 427 } |
| 431 } | 428 } |
| 432 }; | 429 }; |
| OLD | NEW |