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

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: Remove unlock buttons. 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 1486
1486 chrome.send('getManagedUserElevated'); 1487 chrome.send('getManagedUserElevated');
1487 } 1488 }
1488 1489
1489 var title = loadTimeData.getString('title'); 1490 var title = loadTimeData.getString('title');
1490 uber.invokeMethodOnParent('setTitle', {title: title}); 1491 uber.invokeMethodOnParent('setTitle', {title: title});
1491 1492
1492 // Adjust the position of the notification bar when the window size changes. 1493 // Adjust the position of the notification bar when the window size changes.
1493 window.addEventListener('resize', 1494 window.addEventListener('resize',
1494 historyView.positionNotificationBar.bind(historyView)); 1495 historyView.positionNotificationBar.bind(historyView));
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 function updateEntries(entries) { 1831 function updateEntries(entries) {
1831 historyView.updateManagedEntries(entries); 1832 historyView.updateManagedEntries(entries);
1832 } 1833 }
1833 1834
1834 /** 1835 /**
1835 * Called when the page is initialized or when the authentication status 1836 * Called when the page is initialized or when the authentication status
1836 * of the managed user changes. 1837 * of the managed user changes.
1837 * @param {Object} isElevated Contains the information if the current profile is 1838 * @param {Object} isElevated Contains the information if the current profile is
1838 * in elevated state. 1839 * in elevated state.
1839 */ 1840 */
1840 function managedUserElevated(isElevated) { 1841 function managedUserElevated(isElevated) {
Bernhard Bauer 2013/04/11 13:31:18 Do we even expect this whole method to be called o
Adrian Kuegel 2013/04/11 15:56:10 I guess I should move the call to chrome.send('get
1841 if (isElevated) { 1842 if (isElevated) {
1842 document.body.classList.remove('managed-user-locked'); 1843 document.body.classList.remove('managed-user-locked');
1843 $('lock-unlock-button').textContent = loadTimeData.getString('lockButton'); 1844 if (!cr.isChromeOS)
1845 $('lock-unlock-button').textContent =
1846 loadTimeData.getString('lockButton');
1844 } else { 1847 } else {
1845 document.body.classList.add('managed-user-locked'); 1848 document.body.classList.add('managed-user-locked');
1846 $('lock-unlock-button').textContent = 1849 if (!cr.isChromeOS) {
1847 loadTimeData.getString('unlockButton'); 1850 $('lock-unlock-button').textContent =
1851 loadTimeData.getString('unlockButton');
1852 }
1848 } 1853 }
1849 } 1854 }
1850 1855
1851 // Add handlers to HTML elements. 1856 // Add handlers to HTML elements.
1852 document.addEventListener('DOMContentLoaded', load); 1857 document.addEventListener('DOMContentLoaded', load);
1853 1858
1854 // This event lets us enable and disable menu items before the menu is shown. 1859 // This event lets us enable and disable menu items before the menu is shown.
1855 document.addEventListener('canExecute', function(e) { 1860 document.addEventListener('canExecute', function(e) {
1856 e.canExecute = true; 1861 e.canExecute = true;
1857 }); 1862 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698