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

Side by Side Diff: chrome/browser/resources/policy.js

Issue 1023093003: The PolicyTable decorates <table> so it needs to extend HTMLTableElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 cr.define('policy', function() { 4 cr.define('policy', function() {
5 5
6 /** 6 /**
7 * A hack to check if we are displaying the mobile version of this page by 7 * A hack to check if we are displaying the mobile version of this page by
8 * checking if the first column is hidden. 8 * checking if the first column is hidden.
9 * @return {boolean} True if this is the mobile version. 9 * @return {boolean} True if this is the mobile version.
10 */ 10 */
11 var isMobilePage = function() { 11 var isMobilePage = function() {
12 return document.defaultView.getComputedStyle(document.querySelector( 12 return document.defaultView.getComputedStyle(document.querySelector(
13 '.scope-column')).display == 'none'; 13 '.scope-column')).display == 'none';
14 } 14 };
15 15
16 /** 16 /**
17 * A box that shows the status of cloud policy for a device or user. 17 * A box that shows the status of cloud policy for a device or user.
18 * @constructor 18 * @constructor
19 * @extends {HTMLFieldSetElement} 19 * @extends {HTMLFieldSetElement}
20 */ 20 */
21 var StatusBox = cr.ui.define(function() { 21 var StatusBox = cr.ui.define(function() {
22 var node = $('status-box-template').cloneNode(true); 22 var node = $('status-box-template').cloneNode(true);
23 node.removeAttribute('id'); 23 node.removeAttribute('id');
24 return node; 24 return node;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 */ 200 */
201 toggleExpandedValue_: function() { 201 toggleExpandedValue_: function() {
202 this.classList.toggle('show-overflowed-value'); 202 this.classList.toggle('show-overflowed-value');
203 this.updateToggleExpandedValueText_(); 203 this.updateToggleExpandedValueText_();
204 }, 204 },
205 }; 205 };
206 206
207 /** 207 /**
208 * A table of policies and their values. 208 * A table of policies and their values.
209 * @constructor 209 * @constructor
210 * @extends {HTMLTableSectionElement} 210 * @extends {HTMLTableElement}
211 */ 211 */
212 var PolicyTable = cr.ui.define('tbody'); 212 var PolicyTable = cr.ui.define('tbody');
213 213
214 PolicyTable.prototype = { 214 PolicyTable.prototype = {
215 // Set up the prototype chain. 215 // Set up the prototype chain.
216 __proto__: HTMLTableSectionElement.prototype, 216 __proto__: HTMLTableElement.prototype,
217 217
218 /** 218 /**
219 * Initialization function for the cr.ui framework. 219 * Initialization function for the cr.ui framework.
220 */ 220 */
221 decorate: function() { 221 decorate: function() {
222 this.policies_ = {}; 222 this.policies_ = {};
223 this.filterPattern_ = ''; 223 this.filterPattern_ = '';
224 window.addEventListener('resize', this.checkOverflow_.bind(this)); 224 window.addEventListener('resize', this.checkOverflow_.bind(this));
225 }, 225 },
226 226
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 return { 550 return {
551 Page: Page 551 Page: Page
552 }; 552 };
553 }); 553 });
554 554
555 // Have the main initialization function be called when the page finishes 555 // Have the main initialization function be called when the page finishes
556 // loading. 556 // loading.
557 document.addEventListener( 557 document.addEventListener(
558 'DOMContentLoaded', 558 'DOMContentLoaded',
559 policy.Page.getInstance().initialize.bind(policy.Page.getInstance())); 559 policy.Page.getInstance().initialize.bind(policy.Page.getInstance()));
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