Index: chrome/browser/resources/managed_user_passphrase_dialog.js |
diff --git a/chrome/browser/resources/managed_user_passphrase_dialog.js b/chrome/browser/resources/managed_user_passphrase_dialog.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4450773561d6d447035688d1b8f199d81107ae9e |
--- /dev/null |
+++ b/chrome/browser/resources/managed_user_passphrase_dialog.js |
@@ -0,0 +1,27 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+function load() { |
+ $('unlock_passphrase_button').onclick = function(event) { |
+ if ($('passphrase_entry').value == '') { |
Bernhard Bauer
2013/01/07 14:20:22
Braces around one-line statements are unnecessary.
Pam (message me for reviews)
2013/01/07 14:51:49
Should we support an empty password, if I decide n
|
+ return; |
Bernhard Bauer
2013/01/07 14:20:22
Hm, does that mean that we don't allow empty passw
|
+ } |
+ chrome.send('checkPassphrase', [$('passphrase_entry').value]); |
+ $('passphrase_entry').value = ''; |
Pam (message me for reviews)
2013/01/07 14:51:49
Is this necessary? I always find it a little odd-l
|
+ } |
Bernhard Bauer
2013/01/07 14:20:22
Needs a semicolon.
|
+ $('cancel_passphrase_button').onclick = function(event) { |
+ chrome.send('DialogClose'); |
+ } |
Bernhard Bauer
2013/01/07 14:20:22
Semicolon.
|
+} |
+ |
+function passphraseCorrect() { |
+ chrome.send('DialogClose', ['correct']); |
Bernhard Bauer
2013/01/07 14:20:22
Do you need to pass a string constant? Could you p
|
+} |
+ |
+function passphraseIncorrect() { |
+ $('incorrect_passphrase_warning').style.visibility = 'visible'; |
Bernhard Bauer
2013/01/07 14:20:22
Modifying style attributes directly kinda violates
|
+} |
+ |
+// Add handlers to HTML elements. |
Bernhard Bauer
2013/01/07 14:20:22
This comment isn't really necessary :-D
|
+window.addEventListener('DOMContentLoaded', load); |