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

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: Fixed. 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 var allEntries = 619 var allEntries =
620 fm.getAllEntriesInCurrentDirectory().filter(FileType.isImageOrVideo); 620 fm.getAllEntriesInCurrentDirectory().filter(FileType.isImageOrVideo);
621 621
622 var galleryFrame = fm.document_.createElement('iframe'); 622 var galleryFrame = fm.document_.createElement('iframe');
623 galleryFrame.className = 'overlay-pane'; 623 galleryFrame.className = 'overlay-pane';
624 galleryFrame.scrolling = 'no'; 624 galleryFrame.scrolling = 'no';
625 galleryFrame.setAttribute('webkitallowfullscreen', true); 625 galleryFrame.setAttribute('webkitallowfullscreen', true);
626 626
627 if (this.params_ && this.params_.gallery) { 627 if (this.params_ && this.params_.gallery) {
628 // Remove the Gallery state from the location, we do not need it any more. 628 // Remove the Gallery state from the location, we do not need it any more.
629 util.updateAppState(null /* keep path */, '' /* remove search. */); 629 // TODO(mtomasz): Consider keeping the selection path.
630 util.updateAppState(
631 null, /* keep current directory */
632 '', /* remove current selection */
633 '' /* remove search. */);
630 } 634 }
631 635
632 var savedAppState = window.appState; 636 var savedAppState = JSON.parse(JSON.stringify(window.appState));
633 var savedTitle = document.title; 637 var savedTitle = document.title;
634 638
635 // Push a temporary state which will be replaced every time the selection 639 // Push a temporary state which will be replaced every time the selection
636 // changes in the Gallery and popped when the Gallery is closed. 640 // changes in the Gallery and popped when the Gallery is closed.
637 util.updateAppState(); 641 util.updateAppState();
638 642
639 var onBack = function(selectedEntries) { 643 var onBack = function(selectedEntries) {
640 fm.directoryModel.selectEntries(selectedEntries); 644 fm.directoryModel.selectEntries(selectedEntries);
641 fm.closeFilePopup(); // Will call Gallery.unload. 645 fm.closeFilePopup(); // Will call Gallery.unload.
642 window.appState = savedAppState; 646 window.appState = savedAppState;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 items, defaultIdx, 841 items, defaultIdx,
838 function(item) { 842 function(item) {
839 onSuccess(item.task); 843 onSuccess(item.task);
840 }); 844 });
841 }; 845 };
842 846
843 FileTasks.decorate('display'); 847 FileTasks.decorate('display');
844 FileTasks.decorate('updateMenuItem'); 848 FileTasks.decorate('updateMenuItem');
845 FileTasks.decorate('execute'); 849 FileTasks.decorate('execute');
846 FileTasks.decorate('executeDefault'); 850 FileTasks.decorate('executeDefault');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698