OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 var localStrings = new LocalStrings(); | 5 var localStrings = new LocalStrings(); |
6 var hasPDFPlugin = true; | 6 var hasPDFPlugin = true; |
7 | 7 |
8 /** | 8 /** |
9 * Window onload handler, sets up the page. | 9 * Window onload handler, sets up the page. |
10 */ | 10 */ |
11 function load() { | 11 function load() { |
| 12 $('print-button').addEventListener('click', function(e) { |
| 13 chrome.send('print'); |
| 14 }); |
12 $('cancel-button').addEventListener('click', function(e) { | 15 $('cancel-button').addEventListener('click', function(e) { |
13 window.close(); | 16 window.close(); |
14 }); | 17 }); |
15 | 18 |
16 chrome.send('getPrinters'); | 19 chrome.send('getPrinters'); |
17 }; | 20 }; |
18 | 21 |
19 /** | 22 /** |
20 * Fill the printer list drop down. | 23 * Fill the printer list drop down. |
21 */ | 24 */ |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 if (!pdfPlugin.onload) { | 67 if (!pdfPlugin.onload) { |
65 hasPDFPlugin = false; | 68 hasPDFPlugin = false; |
66 mainView.removeChild(pdfPlugin); | 69 mainView.removeChild(pdfPlugin); |
67 $('no-plugin').classList.remove('hidden'); | 70 $('no-plugin').classList.remove('hidden'); |
68 return; | 71 return; |
69 } | 72 } |
70 pdfPlugin.onload('onPDFLoad()'); | 73 pdfPlugin.onload('onPDFLoad()'); |
71 } | 74 } |
72 | 75 |
73 window.addEventListener('DOMContentLoaded', load); | 76 window.addEventListener('DOMContentLoaded', load); |
OLD | NEW |