OLD | NEW |
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 exports.didCreateDocumentElement = function() { | 5 exports.didCreateDocumentElement = function() { |
6 var root = new WebKitShadowRoot(document.childNodes[0]); | 6 var root = new WebKitShadowRoot(document.documentElement); |
7 root.appendChild(document.createElement('style')).innerText = | 7 root.appendChild(document.createElement('style')).innerText = |
8 // TODO(jeremya): switch this to use automatic inlining once grit | 8 // TODO(jeremya): switch this to use automatic inlining once grit |
9 // supports inlining into JS. See http://crbug.com/146319. | 9 // supports inlining into JS. See http://crbug.com/146319. |
10 "x-titlebar { height: 24px; width: 100%; " + | 10 "x-titlebar { height: 24px; width: 100%; " + |
11 "position: absolute; left: 0; top: 0; }\n" + | 11 "position: absolute; left: 0; top: 0; }\n" + |
12 "div { padding-top: 24px; }\n" + | 12 "div { padding-top: 24px; }\n" + |
13 ":-webkit-full-screen * { display: none; }\n" + | 13 ":-webkit-full-screen * { display: none; }\n" + |
14 ":-webkit-full-screen-document * { display: none; }\n" + | 14 ":-webkit-full-screen-document * { display: none; }\n" + |
15 "div:-webkit-full-screen, div:-webkit-full-screen-document { " + | 15 "div:-webkit-full-screen, div:-webkit-full-screen-document { " + |
16 "padding-top: 0; }\n" + | 16 "padding-top: 0; }\n" + |
(...skipping 22 matching lines...) Expand all Loading... |
39 "oG2AFd1AfERUB8CM11WOXQXXAGSROyITDNMGkTGAPdAHSFIENAAOQqGEBxHbYwQDcE2ScY" + | 39 "oG2AFd1AfERUB8CM11WOXQXXAGSROyITDNMGkTGAPdAHSFIENAAOQqGEBxHbYwQDcE2ScY" + |
40 "XsMViNgMwRYuOGOBIgMo8gLFgUi1aCQ7IZGcNaieF0h2AQCMABwRdsuhtQAAAABJRU5Erk" + | 40 "XsMViNgMwRYuOGOBIgMo8gLFgUi1aCQ7IZGcNaieF0h2AQCMABwRdsuhtQAAAABJRU5Erk" + |
41 "Jggg==); }\n" | 41 "Jggg==); }\n" |
42 var container = root.appendChild(document.createElement('div')); | 42 var container = root.appendChild(document.createElement('div')); |
43 var titlebar = container.appendChild(document.createElement('x-titlebar')); | 43 var titlebar = container.appendChild(document.createElement('x-titlebar')); |
44 var closeButton = titlebar.appendChild(document.createElement('button')); | 44 var closeButton = titlebar.appendChild(document.createElement('button')); |
45 closeButton.setAttribute('class', 'close'); | 45 closeButton.setAttribute('class', 'close'); |
46 closeButton.addEventListener('click', function() { window.close(); }); | 46 closeButton.addEventListener('click', function() { window.close(); }); |
47 container.appendChild(document.createElement('content')); | 47 container.appendChild(document.createElement('content')); |
48 } | 48 } |
OLD | NEW |