|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 var keygenThread; |
|
8 |
|
9 function onLoad() |
|
10 { |
|
11 keygenThread = window.arguments[0].QueryInterface(Components.interfaces.nsIKeygenThread); |
|
12 |
|
13 if (!keygenThread) { |
|
14 window.close(); |
|
15 return; |
|
16 } |
|
17 |
|
18 setCursor("wait"); |
|
19 |
|
20 var obs = { |
|
21 observe : function keygenListenerObserve(subject, topic, data) { |
|
22 if (topic == "keygen-finished") |
|
23 window.close(); |
|
24 } |
|
25 }; |
|
26 |
|
27 keygenThread.startKeyGeneration(obs); |
|
28 } |
|
29 |
|
30 function onClose() |
|
31 { |
|
32 setCursor("default"); |
|
33 |
|
34 var alreadyClosed = new Object(); |
|
35 keygenThread.userCanceled(alreadyClosed); |
|
36 } |