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

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

Issue 1052943002: Added device naming information to chrome://policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed IOS whitelist Created 5 years, 8 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 | « chrome/browser/resources/policy.html ('k') | chrome/browser/ui/webui/policy_ui.cc » ('j') | 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 */
(...skipping 30 matching lines...) Expand all
41 */ 41 */
42 initialize: function(scope, status) { 42 initialize: function(scope, status) {
43 if (scope == 'device') { 43 if (scope == 'device') {
44 // For device policy, set the appropriate title and populate the topmost 44 // For device policy, set the appropriate title and populate the topmost
45 // status item with the domain the device is enrolled into. 45 // status item with the domain the device is enrolled into.
46 this.querySelector('.legend').textContent = 46 this.querySelector('.legend').textContent =
47 loadTimeData.getString('statusDevice'); 47 loadTimeData.getString('statusDevice');
48 var domain = this.querySelector('.domain'); 48 var domain = this.querySelector('.domain');
49 domain.textContent = status.domain; 49 domain.textContent = status.domain;
50 domain.parentElement.hidden = false; 50 domain.parentElement.hidden = false;
51
52 // Populate the device naming information.
53 // Populate the asset identifier.
54 var assetId = this.querySelector('.asset-id');
55 assetId.textContent = status.assetId ||
56 loadTimeData.getString('notSpecified');
57 assetId.parentElement.hidden = false;
58
59 // Populate the device location.
60 var location = this.querySelector('.location');
61 location.textContent = status.location ||
62 loadTimeData.getString('notSpecified');
63 location.parentElement.hidden = false;
64
65 // Populate the directory API ID.
66 var directoryApiId = this.querySelector('.directory-api-id');
67 directoryApiId.textContent = status.directoryApiId ||
68 loadTimeData.getString('notSpecified');
69 directoryApiId.parentElement.hidden = false;
51 } else { 70 } else {
52 // For user policy, set the appropriate title and populate the topmost 71 // For user policy, set the appropriate title and populate the topmost
53 // status item with the username that policies apply to. 72 // status item with the username that policies apply to.
54 this.querySelector('.legend').textContent = 73 this.querySelector('.legend').textContent =
55 loadTimeData.getString('statusUser'); 74 loadTimeData.getString('statusUser');
56 // Populate the topmost item with the username. 75 // Populate the topmost item with the username.
57 var username = this.querySelector('.username'); 76 var username = this.querySelector('.username');
58 username.textContent = status.username; 77 username.textContent = status.username;
59 username.parentElement.hidden = false; 78 username.parentElement.hidden = false;
60 } 79 }
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 return { 569 return {
551 Page: Page 570 Page: Page
552 }; 571 };
553 }); 572 });
554 573
555 // Have the main initialization function be called when the page finishes 574 // Have the main initialization function be called when the page finishes
556 // loading. 575 // loading.
557 document.addEventListener( 576 document.addEventListener(
558 'DOMContentLoaded', 577 'DOMContentLoaded',
559 policy.Page.getInstance().initialize.bind(policy.Page.getInstance())); 578 policy.Page.getInstance().initialize.bind(policy.Page.getInstance()));
OLDNEW
« no previous file with comments | « chrome/browser/resources/policy.html ('k') | chrome/browser/ui/webui/policy_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698