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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/photo/gallery.js

Issue 144783002: Simplify directory initialization in Files app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 6 years, 10 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
OLDNEW
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 * Called from the main frame when unloading. 8 * Called from the main frame when unloading.
9 * @return {string?} User-visible message on null if it is OK to close. 9 * @return {string?} User-visible message on null if it is OK to close.
10 */ 10 */
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 // If the Gallery was opened on search results the search query will not be 652 // If the Gallery was opened on search results the search query will not be
653 // recorded in the app state and the relaunch will just open the gallery 653 // recorded in the app state and the relaunch will just open the gallery
654 // in the curDirEntry directory. 654 // in the curDirEntry directory.
655 path = this.context_.curDirEntry.fullPath; 655 path = this.context_.curDirEntry.fullPath;
656 window.top.document.title = this.context_.curDirEntry.name; 656 window.top.document.title = this.context_.curDirEntry.name;
657 displayName = 657 displayName =
658 this.displayStringFunction_('GALLERY_ITEMS_SELECTED', 658 this.displayStringFunction_('GALLERY_ITEMS_SELECTED',
659 selectedItems.length); 659 selectedItems.length);
660 } 660 }
661 661
662 window.top.util.updateAppState(path, 662 window.top.util.updateAppState(
663 null, // Keep the current directory.
664 path, // Update the selection.
663 {gallery: (this.currentMode_ === this.mosaicMode_ ? 'mosaic' : 'slide')}); 665 {gallery: (this.currentMode_ === this.mosaicMode_ ? 'mosaic' : 'slide')});
664 666
665 // We can't rename files in readonly directory. 667 // We can't rename files in readonly directory.
666 // We can only rename a single file. 668 // We can only rename a single file.
667 this.filenameEdit_.disabled = selectedItems.length !== 1 || 669 this.filenameEdit_.disabled = selectedItems.length !== 1 ||
668 this.context_.readonlyDirName; 670 this.context_.readonlyDirName;
669 671
670 this.filenameEdit_.value = displayName; 672 this.filenameEdit_.value = displayName;
671 673
672 // Resolve real filesystem path of the current file. 674 // Resolve real filesystem path of the current file.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 */ 868 */
867 Gallery.prototype.updateButtons_ = function() { 869 Gallery.prototype.updateButtons_ = function() {
868 if (this.modeButton_) { 870 if (this.modeButton_) {
869 var oppositeMode = 871 var oppositeMode =
870 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ : 872 this.currentMode_ === this.slideMode_ ? this.mosaicMode_ :
871 this.slideMode_; 873 this.slideMode_;
872 this.modeButton_.title = 874 this.modeButton_.title =
873 this.displayStringFunction_(oppositeMode.getTitle()); 875 this.displayStringFunction_(oppositeMode.getTitle());
874 } 876 }
875 }; 877 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698