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

Unified Diff: chrome/browser/resources/options/certificate_manager.js

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more refactoring Created 7 years 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/options/certificate_manager.js
diff --git a/chrome/browser/resources/options/certificate_manager.js b/chrome/browser/resources/options/certificate_manager.js
index 5620b80c6c27fa972fbf84736255f91a0ffd0c43..280d0426cf2978edbc53bacbd4cff2f489852fb9 100644
--- a/chrome/browser/resources/options/certificate_manager.js
+++ b/chrome/browser/resources/options/certificate_manager.js
@@ -146,26 +146,6 @@ cr.define('options', function() {
},
};
- // TODO(xiyuan): Use notification from backend instead of polling.
- // TPM token check polling timer.
- var tpmPollingTimer;
-
- // Initiate tpm token check if needed.
- function checkTpmToken() {
- var importAndBindButton = $('personalCertsTab-import-and-bind');
-
- if (importAndBindButton && importAndBindButton.disabled)
- chrome.send('checkTpmTokenReady');
- }
-
- // Stop tpm polling timer.
- function stopTpmTokenCheckPolling() {
- if (tpmPollingTimer) {
- window.clearTimeout(tpmPollingTimer);
- tpmPollingTimer = undefined;
- }
- }
-
/////////////////////////////////////////////////////////////////////////////
// CertificateManager class:
@@ -212,14 +192,6 @@ cr.define('options', function() {
OptionsPage.showTab($('personal-certs-nav-tab'));
chrome.send('populateCertificateManager');
}
-
- if (cr.isChromeOS) {
- // Ensure TPM token check on visible and stop polling when hidden.
- if (this.visible)
- checkTpmToken();
- else
- stopTpmTokenCheckPolling();
- }
}
};
@@ -236,16 +208,13 @@ cr.define('options', function() {
CertificateRestoreOverlay.show();
};
- CertificateManager.onCheckTpmTokenReady = function(ready) {
+ CertificateManager.onModelReady = function() {
var importAndBindButton = $('personalCertsTab-import-and-bind');
- if (importAndBindButton) {
- importAndBindButton.disabled = !ready;
-
- // Check again after 5 seconds if Tpm is not ready and certificate manager
- // is still visible.
- if (!ready && CertificateManager.getInstance().visible)
- tpmPollingTimer = window.setTimeout(checkTpmToken, 5000);
- }
+ if (importAndBindButton !== null)
+ importAndBindButton.disabled = false;
+ $('personalCertsTab-import').disabled = false;
+ $('serverCertsTab-import').disabled = false;
+ $('caCertsTab-import').disabled = false;
};
// Export

Powered by Google App Engine
This is Rietveld 408576698