OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 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. | |
4 | |
5 var webview = document.querySelector('webview'); | |
6 | |
7 function start(url, win) { | |
James Hawkins
2013/05/13 22:24:07
nit: Document method (and rename it to be more des
Michael Courage
2013/05/14 17:10:56
Done.
| |
8 webview.src = url; | |
9 if (win) { | |
10 webview.addEventListener('loadstop', function() { | |
11 win.show(); | |
12 }); | |
13 } | |
14 } | |
15 | |
16 document.querySelector('.titlebar-close-button').onclick = function() { | |
17 window.close(); | |
18 }; | |
19 | |
20 chrome.identityPrivate.getResources(function(resources) { | |
21 var style = document.styleSheets[0]; | |
22 | |
23 function insertRule(selector, url) { | |
24 style.insertRule(selector + ' { background-image: url(' + url + '); }', | |
25 style.cssRules.length); | |
26 } | |
27 | |
28 insertRule('.titlebar-close-button', resources.IDR_CLOSE_DIALOG); | |
29 insertRule('.titlebar-close-button:hover', resources.IDR_CLOSE_DIALOG_H); | |
30 insertRule('.titlebar-close-button:active', resources.IDR_CLOSE_DIALOG_P); | |
31 }); | |
OLD | NEW |