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

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

Issue 104643004: Fix broken task handling in Files app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 7 years 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 | chrome/browser/resources/file_manager/foreground/js/file_tasks.js » ('j') | 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) 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 * FileManager constructor. 8 * FileManager constructor.
9 * 9 *
10 * FileManager objects encapsulate the functionality of the file selector 10 * FileManager objects encapsulate the functionality of the file selector
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1513 } else if (opt_selectionEntry) { 1513 } else if (opt_selectionEntry) {
1514 // There is a file to be selected. It means, that we are recovering 1514 // There is a file to be selected. It means, that we are recovering
1515 // the Files app. 1515 // the Files app.
1516 // We call the appropriate methods of FileTasks directly as we do 1516 // We call the appropriate methods of FileTasks directly as we do
1517 // not need any of the preparations that |execute| method does. 1517 // not need any of the preparations that |execute| method does.
1518 // TODO(mtomasz): Change Entry.fullPath to Entry. 1518 // TODO(mtomasz): Change Entry.fullPath to Entry.
1519 var mediaType = FileType.getMediaType(opt_selectionEntry.fullPath); 1519 var mediaType = FileType.getMediaType(opt_selectionEntry.fullPath);
1520 if (mediaType == 'image' || mediaType == 'video') { 1520 if (mediaType == 'image' || mediaType == 'video') {
1521 task = function() { 1521 task = function() {
1522 // TODO(mtomasz): Replace the url with an entry. 1522 // TODO(mtomasz): Replace the url with an entry.
1523 new FileTasks(this, this.params_).openGallery( 1523 new FileTasks(this, this.params_).openGallery([opt_selectionEntry]);
1524 [opt_selectionEntry.toURL()]);
1525 }.bind(this); 1524 }.bind(this);
1526 } else if (mediaType == 'archive') { 1525 } else if (mediaType == 'archive') {
1527 task = function() { 1526 task = function() {
1528 new FileTasks(this, this.params_).mountArchives( 1527 new FileTasks(this, this.params_).mountArchives(
1529 [opt_selectionEntry.toURL()]); 1528 [opt_selectionEntry]);
1530 }.bind(this); 1529 }.bind(this);
1531 } 1530 }
1532 } 1531 }
1533 1532
1534 // If there is a task to be run, run it after the scan is completed. 1533 // If there is a task to be run, run it after the scan is completed.
1535 if (task) { 1534 if (task) {
1536 var listener = function() { 1535 var listener = function() {
1537 this.directoryModel_.removeEventListener( 1536 this.directoryModel_.removeEventListener(
1538 'scan-completed', listener); 1537 'scan-completed', listener);
1539 task(); 1538 task();
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after
3592 callback(this.preferences_); 3591 callback(this.preferences_);
3593 return; 3592 return;
3594 } 3593 }
3595 3594
3596 chrome.fileBrowserPrivate.getPreferences(function(prefs) { 3595 chrome.fileBrowserPrivate.getPreferences(function(prefs) {
3597 this.preferences_ = prefs; 3596 this.preferences_ = prefs;
3598 callback(prefs); 3597 callback(prefs);
3599 }.bind(this)); 3598 }.bind(this));
3600 }; 3599 };
3601 })(); 3600 })();
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/foreground/js/file_tasks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698