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

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

Issue 11309014: File manager: support for zipping selected files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set the pending bytes for zip task to zero. TODO: need to implement per-entry progress update to tr… Created 8 years, 1 month 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 var CommandUtil = {}; 5 var CommandUtil = {};
6 6
7 /** 7 /**
8 * Extracts root on which command event was dispatched. 8 * Extracts root on which command event was dispatched.
9 * 9 *
10 * @param {Event} event Command event for which to retrieve root to operate on. 10 * @param {Event} event Command event for which to retrieve root to operate on.
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 function(task) { 251 function(task) {
252 tasks.execute(task.taskId); 252 tasks.execute(task.taskId);
253 }); 253 });
254 } 254 }
255 }, 255 },
256 canExecute: function(event, fileManager) { 256 canExecute: function(event, fileManager) {
257 var tasks = fileManager.getSelection().tasks; 257 var tasks = fileManager.getSelection().tasks;
258 event.canExecute = tasks && tasks.size() > 1; 258 event.canExecute = tasks && tasks.size() > 1;
259 } 259 }
260 }; 260 };
261
262 /**
263 * Creates zip file for current selection.
264 */
265 Commands.zipSelectionCommand = {
266 execute: function(event, fileManager) {
267 var dirEntry = fileManager.directoryModel_.getCurrentDirEntry();
268 var selectionEntries = fileManager.getSelection().entries;
269 fileManager.copyManager_.zipSelection(dirEntry, fileManager.isOnGData(),
270 selectionEntries);
271 },
272 canExecute: function(event, fileManager) {
273 var selection = fileManager.getSelection();
274 event.canExecute = !fileManager.isOnGData() && selection &&
275 selection.totalCount > 0;
276 }
277 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698