Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/renderer/resources/extensions/inject_app_titlebar.js

Issue 10910112: Correctly inject titlebars into windows whose first element isn't <html> (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698