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

Unified Diff: ui/file_manager/zip_archiver/unpacker/js/passphrase-manager.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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/zip_archiver/unpacker/js/passphrase-manager.js
diff --git a/ui/file_manager/zip_archiver/unpacker/js/passphrase-manager.js b/ui/file_manager/zip_archiver/unpacker/js/passphrase-manager.js
deleted file mode 100644
index 54ac0627cfa4716528520abcfe8b98a13ea9efe5..0000000000000000000000000000000000000000
--- a/ui/file_manager/zip_archiver/unpacker/js/passphrase-manager.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @constructor
- * @param {?string} initPassphrase Initial passphrase for the first passphrase
- * request or NULL if not available. In such case, call to getPassphrase()
- * will invoke a dialog.
- */
-unpacker.PassphraseManager = function(initPassphrase) {
- /**
- * @private {?string}
- */
- this.initPassphrase_ = initPassphrase;
-
- /**
- * @public {?string}
- */
- this.rememberedPassphrase = initPassphrase;
-};
-
-/**
- * Requests a passphrase from the user. If a passphrase was previously
- * remembered, then tries it first. Otherwise shows a passphrase dialog.
- * @return {!Promise.<string>}
- */
-unpacker.PassphraseManager.prototype.getPassphrase = function() {
- return new Promise(function(fulfill, reject) {
- // For the first passphrase request try the init passphrase (which may be
- // incorrect though, so do it only once).
- if (this.initPassphrase_) {
- fulfill(this.initPassphrase_);
- this.initPassphrase_ = null;
- return;
- }
-
- // Ask user for a passphrase.
- chrome.app.window.create(
- '../html/passphrase.html',
- /** @type {!chrome.app.window.CreateWindowOptions} */ ({
- innerBounds: {width: 320, height: 160},
- alwaysOnTop: true,
- resizable: false,
- frame: 'none',
- hidden: true
- }),
- function(passphraseWindow) {
- var passphraseSucceeded = false;
-
- passphraseWindow.onClosed.addListener(function() {
- if (passphraseSucceeded)
- return;
- reject('FAILED');
- }.bind(this));
-
- passphraseWindow.contentWindow.onPassphraseSuccess =
- function(passphrase, remember) {
- passphraseSucceeded = true;
- this.rememberedPassphrase = remember ? passphrase : null;
- fulfill(passphrase);
- }.bind(this);
- }.bind(this));
- }.bind(this));
-}
« no previous file with comments | « ui/file_manager/zip_archiver/unpacker/js/passphrase-dialog.js ('k') | ui/file_manager/zip_archiver/unpacker/js/request.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698