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

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

Issue 14066003: Don't allow elevation for CHROME_OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 7 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
OLDNEW
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 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 }); 1469 });
1470 1470
1471 // Only show the controls if the command line switch is activated. 1471 // Only show the controls if the command line switch is activated.
1472 if (loadTimeData.getBoolean('groupByDomain') || 1472 if (loadTimeData.getBoolean('groupByDomain') ||
1473 loadTimeData.getBoolean('isManagedProfile')) { 1473 loadTimeData.getBoolean('isManagedProfile')) {
1474 $('filter-controls').hidden = false; 1474 $('filter-controls').hidden = false;
1475 } 1475 }
1476 if (loadTimeData.getBoolean('isManagedProfile')) { 1476 if (loadTimeData.getBoolean('isManagedProfile')) {
1477 $('allow-selected').hidden = false; 1477 $('allow-selected').hidden = false;
1478 $('block-selected').hidden = false; 1478 $('block-selected').hidden = false;
1479 $('lock-unlock-button').classList.add('profile-is-managed'); 1479 if (!cr.isChromeOS) {
1480 1480 $('lock-unlock-button').classList.add('profile-is-managed');
1481 $('lock-unlock-button').addEventListener('click', function(e) { 1481 $('lock-unlock-button').addEventListener('click', function(e) {
1482 var isLocked = document.body.classList.contains('managed-user-locked'); 1482 var isLocked = document.body.classList.contains('managed-user-locked');
1483 chrome.send('setManagedUserElevated', [isLocked]); 1483 chrome.send('setManagedUserElevated', [isLocked]);
1484 }); 1484 });
1485 1485 chrome.send('getManagedUserElevated');
1486 chrome.send('getManagedUserElevated'); 1486 }
1487 } 1487 }
1488 1488
1489 var title = loadTimeData.getString('title'); 1489 var title = loadTimeData.getString('title');
1490 uber.invokeMethodOnParent('setTitle', {title: title}); 1490 uber.invokeMethodOnParent('setTitle', {title: title});
1491 1491
1492 // Adjust the position of the notification bar when the window size changes. 1492 // Adjust the position of the notification bar when the window size changes.
1493 window.addEventListener('resize', 1493 window.addEventListener('resize',
1494 historyView.positionNotificationBar.bind(historyView)); 1494 historyView.positionNotificationBar.bind(historyView));
1495 1495
1496 if (isMobileVersion()) { 1496 if (isMobileVersion()) {
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 1833
1834 /** 1834 /**
1835 * Called when the page is initialized or when the authentication status 1835 * Called when the page is initialized or when the authentication status
1836 * of the managed user changes. 1836 * of the managed user changes.
1837 * @param {Object} isElevated Contains the information if the current profile is 1837 * @param {Object} isElevated Contains the information if the current profile is
1838 * in elevated state. 1838 * in elevated state.
1839 */ 1839 */
1840 function managedUserElevated(isElevated) { 1840 function managedUserElevated(isElevated) {
1841 if (isElevated) { 1841 if (isElevated) {
1842 document.body.classList.remove('managed-user-locked'); 1842 document.body.classList.remove('managed-user-locked');
1843 $('lock-unlock-button').textContent = loadTimeData.getString('lockButton'); 1843 $('lock-unlock-button').textContent =
1844 loadTimeData.getString('lockButton');
1844 } else { 1845 } else {
1845 document.body.classList.add('managed-user-locked'); 1846 document.body.classList.add('managed-user-locked');
1846 $('lock-unlock-button').textContent = 1847 $('lock-unlock-button').textContent =
1847 loadTimeData.getString('unlockButton'); 1848 loadTimeData.getString('unlockButton');
1848 } 1849 }
1849 } 1850 }
1850 1851
1851 // Add handlers to HTML elements. 1852 // Add handlers to HTML elements.
1852 document.addEventListener('DOMContentLoaded', load); 1853 document.addEventListener('DOMContentLoaded', load);
1853 1854
1854 // This event lets us enable and disable menu items before the menu is shown. 1855 // This event lets us enable and disable menu items before the menu is shown.
1855 document.addEventListener('canExecute', function(e) { 1856 document.addEventListener('canExecute', function(e) {
1856 e.canExecute = true; 1857 e.canExecute = true;
1857 }); 1858 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698