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

Unified Diff: chrome/browser/resources/options/managed_user_settings.js

Issue 14066003: Don't allow elevation for CHROME_OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bug in set_elevated function. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/managed_user_settings.js
diff --git a/chrome/browser/resources/options/managed_user_settings.js b/chrome/browser/resources/options/managed_user_settings.js
index fb51882ed4ad6f87603761f44b7bf6f5477ea957..8fe468f22ff872abfe9be6ad7d080ef6ca46be47 100644
--- a/chrome/browser/resources/options/managed_user_settings.js
+++ b/chrome/browser/resources/options/managed_user_settings.js
@@ -73,41 +73,44 @@ cr.define('options', function() {
window.open(loadTimeData.getString('getContentPacksURL'));
};
- $('set-passphrase').onclick = function() {
- OptionsPage.navigateToPage('setPassphrase');
- };
-
- $('use-passphrase-checkbox').onclick = function() {
- $('set-passphrase').disabled = !$('use-passphrase-checkbox').checked;
- };
-
- var self = this;
-
- $('lock-settings').onclick = function() {
- chrome.send('setElevated', [false]);
- // The managed user is currently authenticated, so don't wait for a
- // callback to set the new authentication state since a reset to not
- // elevated is done without showing the passphrase dialog.
- self.authenticationState = ManagedUserAuthentication.UNAUTHENTICATED;
- self.enableControls(false);
- };
-
- $('unlock-settings').onclick = function() {
- if (self.authenticationState == ManagedUserAuthentication.CHECKING)
- return;
- self.authenticationState = ManagedUserAuthentication.CHECKING;
- chrome.send('setElevated', [true]);
- };
+ if (!cr.isChromeOS) {
+ $('set-passphrase').onclick = function() {
+ OptionsPage.navigateToPage('setPassphrase');
+ };
+
+ $('use-passphrase-checkbox').onclick = function() {
+ $('set-passphrase').disabled = !$('use-passphrase-checkbox').checked;
+ };
+
+ var self = this;
+ $('lock-settings').onclick = function() {
+ chrome.send('setElevated', [false]);
+ // The managed user is currently authenticated, so don't wait for a
+ // callback to set the new authentication state since a reset to not
+ // elevated is done without showing the passphrase dialog.
+ self.authenticationState = ManagedUserAuthentication.UNAUTHENTICATED;
+ self.enableControls(false);
+ };
+
+ $('unlock-settings').onclick = function() {
+ if (self.authenticationState == ManagedUserAuthentication.CHECKING)
+ return;
+ self.authenticationState = ManagedUserAuthentication.CHECKING;
+ chrome.send('setElevated', [true]);
+ };
+ }
},
/** @override */
handleConfirm: function() {
- if ($('use-passphrase-checkbox').checked && !this.isPassphraseSet) {
- OptionsPage.navigateToPage('setPassphrase');
- return;
+ if (!cr.isChromeOS) {
+ if ($('use-passphrase-checkbox').checked && !this.isPassphraseSet) {
+ OptionsPage.navigateToPage('setPassphrase');
+ return;
+ }
+ if (!$('use-passphrase-checkbox').checked)
+ chrome.send('resetPassphrase');
}
- if (!$('use-passphrase-checkbox').checked)
- chrome.send('resetPassphrase');
SettingsDialog.prototype.handleConfirm.call(this);
},
@@ -122,8 +125,11 @@ cr.define('options', function() {
// Enables or disables all controls based on the authentication state of
// the managed user. If |enable| is true, the controls will be enabled.
enableControls: function(enable) {
- $('set-passphrase').disabled =
- !enable || !$('use-passphrase-checkbox').checked;
+ if (!cr.isChromeOS) {
+ $('set-passphrase').disabled =
+ !enable || !$('use-passphrase-checkbox').checked;
+ $('use-passphrase-checkbox').disabled = !enable;
+ }
// TODO(sergiu): make $('get-content-packs-button') behave the same as
// the other controls once the button actually does something.
$('manage-exceptions-button').disabled = !enable;
@@ -136,7 +142,6 @@ cr.define('options', function() {
!enable);
// TODO(akuegel): Add disable-history-deletion-checkbox once this feature
// is implemented.
- $('use-passphrase-checkbox').disabled = !enable;
if (enable)
$('managed-user-settings-page').classList.remove('locked');
else
« no previous file with comments | « chrome/browser/resources/options/managed_user_settings.html ('k') | chrome/browser/resources/options/options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698