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

Side by Side Diff: chrome/browser/resources/managed_user_passphrase_dialog.js

Issue 15715005: Remove passphrase dialog and last parts of elevation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 7 years, 6 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
(Empty)
1 // Copyright (c) 2013 The Chromium 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 function load() {
6 var checkPassphrase = function(event) {
7 chrome.send('checkPassphrase', [$('passphrase-entry').value]);
8 };
9 var closeDialog = function(event) {
10 // TODO(akuegel): Replace by closeDialog.
11 chrome.send('DialogClose');
12 };
13 // Directly set the focus on the input box so the user can start typing right
14 // away.
15 $('passphrase-entry').focus();
16 $('unlock-passphrase-button').onclick = checkPassphrase;
17 $('cancel-passphrase-button').onclick = closeDialog;
18 $('passphrase-entry').oninput = function(event) {
19 $('unlock-passphrase-button').disabled = $('passphrase-entry').value == '';
20 $('incorrect-passphrase-warning').hidden = true;
21 };
22 $('passphrase-entry').onkeypress = function(event) {
23 // Check if the user pressed enter.
24 if (event.keyCode == 13)
25 checkPassphrase(event);
26 };
27
28 // Pressing escape anywhere in the frame should work.
29 document.onkeyup = function(event) {
30 // Check if the user pressed escape.
31 if (event.keyCode == 27)
32 closeDialog(event);
33 };
34 }
35
36 function passphraseResult(passphraseCorrect) {
37 if (passphraseCorrect) {
38 chrome.send('DialogClose', ['true']);
39 } else {
40 $('incorrect-passphrase-warning').hidden = false;
41 $('passphrase-entry').focus();
42 }
43 }
44
45 window.addEventListener('DOMContentLoaded', load);
OLDNEW
« no previous file with comments | « chrome/browser/resources/managed_user_passphrase_dialog.html ('k') | chrome/browser/ui/webui/managed_user_passphrase_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698