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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/file_tasks.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, 11 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 * This object encapsulates everything related to tasks execution. 8 * This object encapsulates everything related to tasks execution.
9 * 9 *
10 * @param {FileManager} fileManager FileManager instance. 10 * @param {FileManager} fileManager FileManager instance.
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 var allEntries = 635 var allEntries =
636 fm.getAllEntriesInCurrentDirectory().filter(FileType.isImageOrVideo); 636 fm.getAllEntriesInCurrentDirectory().filter(FileType.isImageOrVideo);
637 637
638 var galleryFrame = fm.document_.createElement('iframe'); 638 var galleryFrame = fm.document_.createElement('iframe');
639 galleryFrame.className = 'overlay-pane'; 639 galleryFrame.className = 'overlay-pane';
640 galleryFrame.scrolling = 'no'; 640 galleryFrame.scrolling = 'no';
641 galleryFrame.setAttribute('webkitallowfullscreen', true); 641 galleryFrame.setAttribute('webkitallowfullscreen', true);
642 642
643 if (this.params_ && this.params_.gallery) { 643 if (this.params_ && this.params_.gallery) {
644 // Remove the Gallery state from the location, we do not need it any more. 644 // Remove the Gallery state from the location, we do not need it any more.
645 util.updateAppState(null /* keep path */, '' /* remove search. */); 645 // TODO(mtomasz): Consider keeping the selection path.
646 util.updateAppState(
647 null, /* keep current directory */
648 '', /* remove current selection */
649 '' /* remove search. */);
646 } 650 }
647 651
648 var savedAppState = window.appState; 652 var savedAppState = JSON.parse(JSON.stringify(window.appState));
649 var savedTitle = document.title; 653 var savedTitle = document.title;
650 654
651 // Push a temporary state which will be replaced every time the selection 655 // Push a temporary state which will be replaced every time the selection
652 // changes in the Gallery and popped when the Gallery is closed. 656 // changes in the Gallery and popped when the Gallery is closed.
653 util.updateAppState(); 657 util.updateAppState();
654 658
655 var onBack = function(selectedEntries) { 659 var onBack = function(selectedEntries) {
656 fm.directoryModel.selectEntries(selectedEntries); 660 fm.directoryModel.selectEntries(selectedEntries);
657 fm.closeFilePopup(); // Will call Gallery.unload. 661 fm.closeFilePopup(); // Will call Gallery.unload.
658 window.appState = savedAppState; 662 window.appState = savedAppState;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 items, defaultIdx, 857 items, defaultIdx,
854 function(item) { 858 function(item) {
855 onSuccess(item.task); 859 onSuccess(item.task);
856 }); 860 });
857 }; 861 };
858 862
859 FileTasks.decorate('display'); 863 FileTasks.decorate('display');
860 FileTasks.decorate('updateMenuItem'); 864 FileTasks.decorate('updateMenuItem');
861 FileTasks.decorate('execute'); 865 FileTasks.decorate('execute');
862 FileTasks.decorate('executeDefault'); 866 FileTasks.decorate('executeDefault');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698