| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 * Utility methods. They are intended for use only in this file. | 8 * Utility methods. They are intended for use only in this file. |
| 9 */ | 9 */ |
| 10 var DirectoryTreeUtil = {}; | 10 var DirectoryTreeUtil = {}; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 } | 409 } |
| 410 | 410 |
| 411 // Fallback to the default directory. | 411 // Fallback to the default directory. |
| 412 this.directoryModel_.changeDirectory( | 412 this.directoryModel_.changeDirectory( |
| 413 this.directoryModel_.getDefaultDirectory()); | 413 this.directoryModel_.getDefaultDirectory()); |
| 414 }.bind(this)); | 414 }.bind(this)); |
| 415 | 415 |
| 416 this.privateOnDirectoryChangedBound_ = this.onDirectoryChanged_.bind(this); | 416 this.privateOnDirectoryChangedBound_ = this.onDirectoryChanged_.bind(this); |
| 417 chrome.fileBrowserPrivate.onDirectoryChanged.addListener( | 417 chrome.fileBrowserPrivate.onDirectoryChanged.addListener( |
| 418 this.privateOnDirectoryChangedBound_); | 418 this.privateOnDirectoryChangedBound_); |
| 419 |
| 420 if (util.platform.newUI()) |
| 421 ScrollBar.createVertical(this.parentNode, this); |
| 419 }; | 422 }; |
| 420 | 423 |
| 421 /** | 424 /** |
| 422 * Sets a context menu. Context menu is enabled only on archive and removable | 425 * Sets a context menu. Context menu is enabled only on archive and removable |
| 423 * volumes as of now. | 426 * volumes as of now. |
| 424 * | 427 * |
| 425 * @param {cr.ui.Menu} menu Context menu. | 428 * @param {cr.ui.Menu} menu Context menu. |
| 426 */ | 429 */ |
| 427 DirectoryTree.prototype.setContextMenu = function(menu) { | 430 DirectoryTree.prototype.setContextMenu = function(menu) { |
| 428 this.contextMenu_ = menu; | 431 this.contextMenu_ = menu; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 496 } |
| 494 }; | 497 }; |
| 495 | 498 |
| 496 /** | 499 /** |
| 497 * Returns the path of the selected item. | 500 * Returns the path of the selected item. |
| 498 * @return {string} The current path. | 501 * @return {string} The current path. |
| 499 */ | 502 */ |
| 500 DirectoryTree.prototype.getCurrentPath = function() { | 503 DirectoryTree.prototype.getCurrentPath = function() { |
| 501 return this.selectedItem ? this.selectedItem.fullPath : null; | 504 return this.selectedItem ? this.selectedItem.fullPath : null; |
| 502 }; | 505 }; |
| OLD | NEW |