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

Side by Side Diff: chrome/browser/resources/certificate_viewer.js

Issue 10446076: Handle Escape key on constrained window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('cert_viewer', function() { 5 cr.define('cert_viewer', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Initialize the certificate viewer dialog by wiring up the close button, 9 * Initialize the certificate viewer dialog by wiring up the close button,
10 * substituting in translated strings and requesting certificate details. 10 * substituting in translated strings and requesting certificate details.
(...skipping 28 matching lines...) Expand all
39 setTimeout(initializeDetailTab, 200); 39 setTimeout(initializeDetailTab, 200);
40 40
41 $('tabbox').addEventListener('selectedChange', function f(e) { 41 $('tabbox').addEventListener('selectedChange', function f(e) {
42 $('tabbox').removeEventListener('selectedChange', f); 42 $('tabbox').removeEventListener('selectedChange', f);
43 initializeDetailTab(); 43 initializeDetailTab();
44 }, true); 44 }, true);
45 45
46 stripGtkAccessorKeys(); 46 stripGtkAccessorKeys();
47 47
48 $('export').onclick = exportCertificate; 48 $('export').onclick = exportCertificate;
49
50 // TODO(kochi): ESC key should be handled in the views window side.
51 document.addEventListener('keydown', function(e) {
52 if (e.keyCode == 27) // ESC
53 chrome.send('DialogClose');
54 });
55 } 49 }
56 50
57 /** 51 /**
58 * Decorate a function so that it can only be invoked once. 52 * Decorate a function so that it can only be invoked once.
59 */ 53 */
60 function oneShot(fn) { 54 function oneShot(fn) {
61 var fired = false; 55 var fired = false;
62 return function() { 56 return function() {
63 if (fired) return; 57 if (fired) return;
64 fired = true; 58 fired = true;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 chrome.send('exportCertificate', [item.detail.payload.index]); 204 chrome.send('exportCertificate', [item.detail.payload.index]);
211 } 205 }
212 206
213 return { 207 return {
214 initialize: initialize, 208 initialize: initialize,
215 getCertificateFields: getCertificateFields, 209 getCertificateFields: getCertificateFields,
216 }; 210 };
217 }); 211 });
218 212
219 document.addEventListener('DOMContentLoaded', cert_viewer.initialize); 213 document.addEventListener('DOMContentLoaded', cert_viewer.initialize);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698