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

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

Issue 214093002: Replace deprecated webkitCreateShadowRoot with createShadowRoot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 // 5 //
6 // <window-controls> shadow element implementation. 6 // <window-controls> shadow element implementation.
7 // 7 //
8 8
9 var chrome = requireNative('chrome').GetChrome(); 9 var chrome = requireNative('chrome').GetChrome();
10 var forEach = require('utils').forEach; 10 var forEach = require('utils').forEach;
(...skipping 22 matching lines...) Expand all
33 WindowControls.prototype.createShadowRoot_ = function(node) { 33 WindowControls.prototype.createShadowRoot_ = function(node) {
34 // Initialize |template| from HTML template resource and cache result. 34 // Initialize |template| from HTML template resource and cache result.
35 var template = WindowControls.prototype.template_element; 35 var template = WindowControls.prototype.template_element;
36 if (!template) { 36 if (!template) {
37 var element = document.createElement('div'); 37 var element = document.createElement('div');
38 element.innerHTML = getHtmlTemplate(); 38 element.innerHTML = getHtmlTemplate();
39 WindowControls.prototype.template_element = element.firstChild; 39 WindowControls.prototype.template_element = element.firstChild;
40 template = WindowControls.prototype.template_element; 40 template = WindowControls.prototype.template_element;
41 } 41 }
42 // Create shadow root element with template clone as first child. 42 // Create shadow root element with template clone as first child.
43 var shadowRoot = node.webkitCreateShadowRoot(); 43 var shadowRoot = node.createShadowRoot();
44 shadowRoot.appendChild(template.content.cloneNode(true)); 44 shadowRoot.appendChild(template.content.cloneNode(true));
45 return shadowRoot; 45 return shadowRoot;
46 } 46 }
47 47
48 /** 48 /**
49 * @private 49 * @private
50 */ 50 */
51 WindowControls.prototype.setupWindowControls_ = function() { 51 WindowControls.prototype.setupWindowControls_ = function() {
52 var self = this; 52 var self = this;
53 this.shadowRoot_.querySelector("#close-control").addEventListener('click', 53 this.shadowRoot_.querySelector("#close-control").addEventListener('click',
(...skipping 15 matching lines...) Expand all
69 if (chrome.app.window.current().isMaximized()) { 69 if (chrome.app.window.current().isMaximized()) {
70 chrome.app.window.current().restore(); 70 chrome.app.window.current().restore();
71 } else { 71 } else {
72 chrome.app.window.current().maximize(); 72 chrome.app.window.current().maximize();
73 } 73 }
74 } 74 }
75 75
76 addTagWatcher('WINDOW-CONTROLS', function(addedNode) { 76 addTagWatcher('WINDOW-CONTROLS', function(addedNode) {
77 new WindowControls(addedNode); 77 new WindowControls(addedNode);
78 }); 78 });
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/web_view.js ('k') | chrome/test/chromedriver/js/call_function_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698