Chromium Code Reviews| 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 // Populate the device naming information | |
|
Mattias Nissler (ping if slow)
2015/04/02 12:11:29
Nit (here and below): Sentences in comments should
Polina Bondarenko
2015/04/08 09:59:35
Done.
| |
| 52 // Populate the asset identifier | |
| 53 var assetId = this.querySelector('.asset-id'); | |
| 54 assetId.textContent = status.assetId; | |
| 55 assetId.parentElement.hidden = false; | |
| 56 // Populate the device location | |
| 57 var location = this.querySelector('.location'); | |
| 58 location.textContent = status.location; | |
| 59 location.parentElement.hidden = false; | |
| 60 // Populate the directory API ID | |
| 61 var directoryApiId = this.querySelector('.directory-api-id'); | |
| 62 directoryApiId.textContent = status.directoryApiId; | |
| 63 directoryApiId.parentElement.hidden = false; | |
| 51 } else { | 64 } else { |
| 52 // For user policy, set the appropriate title and populate the topmost | 65 // For user policy, set the appropriate title and populate the topmost |
| 53 // status item with the username that policies apply to. | 66 // status item with the username that policies apply to. |
| 54 this.querySelector('.legend').textContent = | 67 this.querySelector('.legend').textContent = |
| 55 loadTimeData.getString('statusUser'); | 68 loadTimeData.getString('statusUser'); |
| 56 // Populate the topmost item with the username. | 69 // Populate the topmost item with the username. |
| 57 var username = this.querySelector('.username'); | 70 var username = this.querySelector('.username'); |
| 58 username.textContent = status.username; | 71 username.textContent = status.username; |
| 59 username.parentElement.hidden = false; | 72 username.parentElement.hidden = false; |
| 60 } | 73 } |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 return { | 563 return { |
| 551 Page: Page | 564 Page: Page |
| 552 }; | 565 }; |
| 553 }); | 566 }); |
| 554 | 567 |
| 555 // Have the main initialization function be called when the page finishes | 568 // Have the main initialization function be called when the page finishes |
| 556 // loading. | 569 // loading. |
| 557 document.addEventListener( | 570 document.addEventListener( |
| 558 'DOMContentLoaded', | 571 'DOMContentLoaded', |
| 559 policy.Page.getInstance().initialize.bind(policy.Page.getInstance())); | 572 policy.Page.getInstance().initialize.bind(policy.Page.getInstance())); |
| OLD | NEW |