OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
6 | 6 |
7 /////////////////////////////////////////////////////////////////////////////// | 7 /////////////////////////////////////////////////////////////////////////////// |
8 // Globals: | 8 // Globals: |
9 /** @const */ var RESULTS_PER_PAGE = 150; | 9 /** @const */ var RESULTS_PER_PAGE = 150; |
10 | 10 |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 }); | 1463 }); |
1464 | 1464 |
1465 // Only show the controls if the command line switch is activated. | 1465 // Only show the controls if the command line switch is activated. |
1466 if (loadTimeData.getBoolean('groupByDomain') || | 1466 if (loadTimeData.getBoolean('groupByDomain') || |
1467 loadTimeData.getBoolean('isManagedProfile')) { | 1467 loadTimeData.getBoolean('isManagedProfile')) { |
1468 $('filter-controls').hidden = false; | 1468 $('filter-controls').hidden = false; |
1469 } | 1469 } |
1470 if (loadTimeData.getBoolean('isManagedProfile')) { | 1470 if (loadTimeData.getBoolean('isManagedProfile')) { |
1471 $('allow-selected').hidden = false; | 1471 $('allow-selected').hidden = false; |
1472 $('block-selected').hidden = false; | 1472 $('block-selected').hidden = false; |
1473 $('lock-unlock-button').classList.add('profile-is-managed'); | 1473 if (!cr.isChromeOS) { |
1474 | 1474 $('lock-unlock-button').classList.add('profile-is-managed'); |
1475 $('lock-unlock-button').addEventListener('click', function(e) { | 1475 $('lock-unlock-button').addEventListener('click', function(e) { |
1476 var isLocked = document.body.classList.contains('managed-user-locked'); | 1476 var isLocked = document.body.classList.contains('managed-user-locked'); |
1477 chrome.send('setManagedUserElevated', [isLocked]); | 1477 chrome.send('setManagedUserElevated', [isLocked]); |
1478 }); | 1478 }); |
1479 | 1479 chrome.send('getManagedUserElevated'); |
1480 chrome.send('getManagedUserElevated'); | 1480 } |
1481 } | 1481 } |
1482 | 1482 |
1483 var title = loadTimeData.getString('title'); | 1483 var title = loadTimeData.getString('title'); |
1484 uber.invokeMethodOnParent('setTitle', {title: title}); | 1484 uber.invokeMethodOnParent('setTitle', {title: title}); |
1485 | 1485 |
1486 // Adjust the position of the notification bar when the window size changes. | 1486 // Adjust the position of the notification bar when the window size changes. |
1487 window.addEventListener('resize', | 1487 window.addEventListener('resize', |
1488 historyView.positionNotificationBar.bind(historyView)); | 1488 historyView.positionNotificationBar.bind(historyView)); |
1489 | 1489 |
1490 if (isMobileVersion()) { | 1490 if (isMobileVersion()) { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 | 1827 |
1828 /** | 1828 /** |
1829 * Called when the page is initialized or when the authentication status | 1829 * Called when the page is initialized or when the authentication status |
1830 * of the managed user changes. | 1830 * of the managed user changes. |
1831 * @param {Object} isElevated Contains the information if the current profile is | 1831 * @param {Object} isElevated Contains the information if the current profile is |
1832 * in elevated state. | 1832 * in elevated state. |
1833 */ | 1833 */ |
1834 function managedUserElevated(isElevated) { | 1834 function managedUserElevated(isElevated) { |
1835 if (isElevated) { | 1835 if (isElevated) { |
1836 document.body.classList.remove('managed-user-locked'); | 1836 document.body.classList.remove('managed-user-locked'); |
1837 $('lock-unlock-button').textContent = loadTimeData.getString('lockButton'); | 1837 $('lock-unlock-button').textContent = |
| 1838 loadTimeData.getString('lockButton'); |
1838 } else { | 1839 } else { |
1839 document.body.classList.add('managed-user-locked'); | 1840 document.body.classList.add('managed-user-locked'); |
1840 $('lock-unlock-button').textContent = | 1841 $('lock-unlock-button').textContent = |
1841 loadTimeData.getString('unlockButton'); | 1842 loadTimeData.getString('unlockButton'); |
1842 } | 1843 } |
1843 } | 1844 } |
1844 | 1845 |
1845 // Add handlers to HTML elements. | 1846 // Add handlers to HTML elements. |
1846 document.addEventListener('DOMContentLoaded', load); | 1847 document.addEventListener('DOMContentLoaded', load); |
1847 | 1848 |
1848 // This event lets us enable and disable menu items before the menu is shown. | 1849 // This event lets us enable and disable menu items before the menu is shown. |
1849 document.addEventListener('canExecute', function(e) { | 1850 document.addEventListener('canExecute', function(e) { |
1850 e.canExecute = true; | 1851 e.canExecute = true; |
1851 }); | 1852 }); |
OLD | NEW |