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

Side by Side Diff: ui/file_manager/zip_archiver/unpacker/js/compressor-foreground.js

Issue 2804453002: Move files from zip_archiver/unpacker/ to zip_archiver/. (Closed)
Patch Set: Move files from zip_archiver/unpacker/ to zip_archiver/. Created 3 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 window.onload = function() {
6 chrome.runtime.getBackgroundPage(function(backgroundPage) {
7
8 // Called from the background page. We need to place this function here
9 // because chrome.fileSystem.chooseEntry only works on forground page.
10 backgroundPage.unpacker.Compressor.prototype.createArchiveFileForeground_ =
11 function(compressorId) {
12 var compressor =
13 backgroundPage.unpacker.app.compressors[compressorId];
14 var suggestedName = compressor.archiveName_;
15 // Create an archive file.
16 chrome.fileSystem.chooseEntry(
17 {type: 'saveFile', suggestedName: suggestedName},
18 function(entry, fileEntries) {
19 if (!entry) {
20 console.error('Failed to create an archive file.');
21 compressor.onError_(compressor.compressorId_);
22 return;
23 }
24
25 compressor.archiveFileEntry_ = entry;
26
27 compressor.sendCreateArchiveRequest_();
28 });
29 };
30
31 // Some compressors are waiting for this foreground page to be loaded.
32 backgroundPage.unpacker.Compressor.CompressorIdQueue.forEach(
33 function(compressorId) {
34 var compressor =
35 backgroundPage.unpacker.app.compressors[compressorId];
36 compressor.createArchiveFileForeground_(compressorId);
37 });
38 });
39 };
OLDNEW
« no previous file with comments | « ui/file_manager/zip_archiver/unpacker/js/compressor.js ('k') | ui/file_manager/zip_archiver/unpacker/js/decompressor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698