Chromium Code Reviews| 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 // DirectoryTreeUtil | 8 // DirectoryTreeUtil |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 completionCallback); | 588 completionCallback); |
| 589 }; | 589 }; |
| 590 | 590 |
| 591 /** | 591 /** |
| 592 * Retrieves the latest subdirectories and update them on the tree. | 592 * Retrieves the latest subdirectories and update them on the tree. |
| 593 * @param {boolean} recursive True if the update is recursively. | 593 * @param {boolean} recursive True if the update is recursively. |
| 594 * @param {function()=} opt_successCallback Callback called on success. | 594 * @param {function()=} opt_successCallback Callback called on success. |
| 595 * @param {function()=} opt_errorCallback Callback called on error. | 595 * @param {function()=} opt_errorCallback Callback called on error. |
| 596 */ | 596 */ |
| 597 DirectoryTree.prototype.updateSubDirectories = function( | 597 DirectoryTree.prototype.updateSubDirectories = function( |
| 598 recursive, opt_successCallback, opt_errorCallback) { | 598 recursive, opt_successCallback, opt_errorCallback) { |
|
hirono
2013/09/10 00:51:13
opt_errorCallback will not be called.
Can we remov
yoshiki
2013/09/10 01:01:01
I want to keep the same interface with DirectoryIt
| |
| 599 var myDriveItem = this.items[0]; | 599 this.entries_ = DirectoryTreeUtil.generateTopLevelEntries(); |
| 600 DirectoryTreeUtil.updateSubDirectories( | 600 this.redraw(recursive); |
| 601 myDriveItem, | 601 if (opt_successCallback) |
| 602 function(entries) { | 602 opt_successCallback(); |
| 603 this.entries_ = entries; | |
| 604 this.redraw(recursive); | |
| 605 if (opt_successCallback) | |
| 606 opt_successCallback(); | |
| 607 }.bind(this), | |
| 608 opt_errorCallback); | |
| 609 }; | 603 }; |
| 610 | 604 |
| 611 /** | 605 /** |
| 612 * Redraw the list. | 606 * Redraw the list. |
| 613 * @param {boolean} recursive True if the update is recursively. False if the | 607 * @param {boolean} recursive True if the update is recursively. False if the |
| 614 * only root items are updated. | 608 * only root items are updated. |
| 615 */ | 609 */ |
| 616 DirectoryTree.prototype.redraw = function(recursive) { | 610 DirectoryTree.prototype.redraw = function(recursive) { |
| 617 DirectoryTreeUtil.updateSubElementsFromList( | 611 DirectoryTreeUtil.updateSubElementsFromList( |
| 618 this, | 612 this, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 666 this.style.paddingBottom = margin + 'px'; | 660 this.style.paddingBottom = margin + 'px'; |
| 667 this.scrollBar_.setBottomMarginForPanel(margin); | 661 this.scrollBar_.setBottomMarginForPanel(margin); |
| 668 }; | 662 }; |
| 669 | 663 |
| 670 /** | 664 /** |
| 671 * Updates the UI after the layout has changed. | 665 * Updates the UI after the layout has changed. |
| 672 */ | 666 */ |
| 673 DirectoryTree.prototype.relayout = function() { | 667 DirectoryTree.prototype.relayout = function() { |
| 674 cr.dispatchSimpleEvent(this, 'relayout'); | 668 cr.dispatchSimpleEvent(this, 'relayout'); |
| 675 }; | 669 }; |
| OLD | NEW |