OLD | NEW |
(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 $('unlock-passphrase-button').onclick = function(event) { |
| 7 chrome.send('checkPassphrase', [$('passphrase-entry').value]); |
| 8 }; |
| 9 $('cancel-passphrase-button').onclick = function(event) { |
| 10 // TODO(akuegel): Replace by closeDialog. |
| 11 chrome.send('DialogClose'); |
| 12 }; |
| 13 $('passphrase-entry').oninput = function(event) { |
| 14 $('unlock-passphrase-button').disabled = $('passphrase-entry').value == ''; |
| 15 $('incorrect-passphrase-warning').hidden = true; |
| 16 }; |
| 17 } |
| 18 |
| 19 function passphraseCorrect() { |
| 20 chrome.send('DialogClose', ['true']); |
| 21 } |
| 22 |
| 23 function passphraseIncorrect() { |
| 24 $('incorrect-passphrase-warning').hidden = false; |
| 25 $('passphrase-entry').focus(); |
| 26 } |
| 27 |
| 28 window.addEventListener('DOMContentLoaded', load); |
OLD | NEW |