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.documentElement); | 6 var root = document.documentElement.webkitCreateShadowRoot(); |
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: fixed; left: 0; top: 0; }\n" + | 11 "position: fixed; left: 0; top: 0; }\n" + |
12 "div { margin-top: 24px; position: absolute; top: 0px; width: 100%; " + | 12 "div { margin-top: 24px; position: absolute; top: 0px; width: 100%; " + |
13 "-webkit-widget-region: region(control rectangle); }\n" + | 13 "-webkit-widget-region: region(control rectangle); }\n" + |
14 ":-webkit-full-screen * { display: none; }\n" + | 14 ":-webkit-full-screen * { display: none; }\n" + |
15 ":-webkit-full-screen-document * { display: none; }\n" + | 15 ":-webkit-full-screen-document * { display: none; }\n" + |
16 "div:-webkit-full-screen, div:-webkit-full-screen-document { " + | 16 "div:-webkit-full-screen, div:-webkit-full-screen-document { " + |
(...skipping 23 matching lines...) Expand all Loading... |
40 "oG2AFd1AfERUB8CM11WOXQXXAGSROyITDNMGkTGAPdAHSFIENAAOQqGEBxHbYwQDcE2ScY" + | 40 "oG2AFd1AfERUB8CM11WOXQXXAGSROyITDNMGkTGAPdAHSFIENAAOQqGEBxHbYwQDcE2ScY" + |
41 "XsMViNgMwRYuOGOBIgMo8gLFgUi1aCQ7IZGcNaieF0h2AQCMABwRdsuhtQAAAABJRU5Erk" + | 41 "XsMViNgMwRYuOGOBIgMo8gLFgUi1aCQ7IZGcNaieF0h2AQCMABwRdsuhtQAAAABJRU5Erk" + |
42 "Jggg==); }\n" | 42 "Jggg==); }\n" |
43 var titlebar = root.appendChild(document.createElement('x-titlebar')); | 43 var titlebar = root.appendChild(document.createElement('x-titlebar')); |
44 var closeButton = titlebar.appendChild(document.createElement('button')); | 44 var closeButton = titlebar.appendChild(document.createElement('button')); |
45 closeButton.className = 'close' | 45 closeButton.className = 'close' |
46 closeButton.addEventListener('click', function() { window.close(); }); | 46 closeButton.addEventListener('click', function() { window.close(); }); |
47 var container = root.appendChild(document.createElement('div')); | 47 var container = root.appendChild(document.createElement('div')); |
48 container.appendChild(document.createElement('content')); | 48 container.appendChild(document.createElement('content')); |
49 } | 49 } |
OLD | NEW |