1 // Copyright (c) 2012 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.
5 cr.define('options', function() {
7 var OptionsPage = options.OptionsPage;
10 * CertificateImportErrorOverlay class
11 * Displays a list of certificates and errors.
14 function CertificateImportErrorOverlay() {
15 OptionsPage.call(this, 'certificateImportErrorOverlay', '',
16 'certificateImportErrorOverlay');
19 cr.addSingletonGetter(CertificateImportErrorOverlay);
21 CertificateImportErrorOverlay.prototype = {
22 // Inherit CertificateImportErrorOverlay from OptionsPage.
23 __proto__: OptionsPage.prototype,
26 * Initialize the page.
28 initializePage: function() {
29 // Call base class implementation to start preference initialization.
30 OptionsPage.prototype.initializePage.call(this);
32 $('certificateImportErrorOverlayOk').onclick = function(event) {
33 OptionsPage.closeOverlay();
39 * Show an alert overlay with the given message, button titles, and
41 * @param {string} title The alert title to display to the user.
42 * @param {string} message The alert message to display to the user.
43 * @param {Array} certErrors The list of cert errors. Each error should have
44 * a .name and .error attribute.
46 CertificateImportErrorOverlay.show = function(title, message, certErrors) {
47 $('certificateImportErrorOverlayTitle').textContent = title;
48 $('certificateImportErrorOverlayMessage').textContent = message;
50 ul = $('certificateImportErrorOverlayCertErrors');
52 for (var i = 0; i < certErrors.length; ++i) {
53 li = document.createElement('li');
54 li.textContent = loadTimeData.getStringF('certificateImportErrorFormat',
60 OptionsPage.navigateToPage('certificateImportErrorOverlay');
65 CertificateImportErrorOverlay: CertificateImportErrorOverlay