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

Unified Diff: chrome/browser/resources/chromeos/cryptohome.js

Issue 10703162: chromeos: Remove CryptohomeLibrary::TpmGetPassword and TpmIsReady (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and add CryptohomeUI Created 8 years, 5 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: chrome/browser/resources/chromeos/cryptohome.js
diff --git a/chrome/browser/resources/chromeos/cryptohome.js b/chrome/browser/resources/chromeos/cryptohome.js
new file mode 100644
index 0000000000000000000000000000000000000000..e5ff8815e05d6dd2eb73d216f88e902c4dd09965
--- /dev/null
+++ b/chrome/browser/resources/chromeos/cryptohome.js
@@ -0,0 +1,42 @@
+// 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.
+
+/**
+ * Sets |value| to the element specified by |destination_id|.
+ * Called from C++ code as a result of RequestCryptohomeProperty() call.
+ * @param {string} destination_id Id of the element to be modified.
+ * @param {string} value The value to be set.
+ */
+function SetCryptohomeProperty(destination_id, value) {
+ $(destination_id).textContent = value;
+}
+
+/**
+ * Requests updating the element specified by |destination_id|.
+ * @param {string} destination_id Id of the element to be modified.
+ */
+function RequestCryptohomeProperty(destination_id) {
+ chrome.send('requestCryptohomeProperty', [destination_id]);
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+ // Request update.
+ RequestCryptohomeProperty('is-mounted');
+ RequestCryptohomeProperty('tpm-is-ready');
+ RequestCryptohomeProperty('tpm-is-enabled');
+ RequestCryptohomeProperty('tpm-is-owned');
+ RequestCryptohomeProperty('tpm-is-being-owned');
+ RequestCryptohomeProperty('pkcs11-is-tpm-token-ready');
+ RequestCryptohomeProperty('is-tpm-token-ready');
+ RequestCryptohomeProperty('token-name');
+ RequestCryptohomeProperty('user-pin');
+
+ // Auto-refresh when interval is given as pathname.
+ var interval = parseInt(window.location.pathname.split('/')[1]);
+ if (interval > 0) {
+ $('refresh-message').textContent =
+ '(Auto-refreshing page every ' + interval + 's)';
+ setTimeout(function() { window.location.reload(true); }, interval * 1000);
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698