Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/browser/resources/file_manager/js/directory_tree.js

Issue 23636014: [Files.app] Use generateTopLevelEntries() method to retrieve the list on the top level (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698