OLD | NEW |
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 Loading... |
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 Loading... |
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())); |
OLD | NEW |