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() {
6 var Page = cr.ui.pageManager.Page;
7 var PageManager = cr.ui.pageManager.PageManager;
10 * CertificateImportErrorOverlay class
11 * Displays a list of certificates and errors.
14 function CertificateImportErrorOverlay() {
15 Page.call(this, 'certificateImportErrorOverlay', '',
16 'certificateImportErrorOverlay');
19 cr.addSingletonGetter(CertificateImportErrorOverlay);
21 CertificateImportErrorOverlay.prototype = {
22 // Inherit CertificateImportErrorOverlay from Page.
23 __proto__: Page.prototype,
26 initializePage: function() {
27 Page.prototype.initializePage.call(this);
29 $('certificateImportErrorOverlayOk').onclick = function(event) {
30 PageManager.closeOverlay();
36 * Show an alert overlay with the given message, button titles, and
38 * @param {string} title The alert title to display to the user.
39 * @param {string} message The alert message to display to the user.
40 * @param {Array} certErrors The list of cert errors. Each error should have
41 * a .name and .error attribute.
43 CertificateImportErrorOverlay.show = function(title, message, certErrors) {
44 $('certificateImportErrorOverlayTitle').textContent = title;
45 $('certificateImportErrorOverlayMessage').textContent = message;
47 var ul = $('certificateImportErrorOverlayCertErrors');
49 for (var i = 0; i < certErrors.length; ++i) {
50 var li = document.createElement('li');
51 li.textContent = loadTimeData.getStringF('certificateImportErrorFormat',
57 PageManager.showPageByName('certificateImportErrorOverlay');
62 CertificateImportErrorOverlay: CertificateImportErrorOverlay