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

Unified Diff: chrome/browser/resources/options2/browser_options.js

Issue 9464053: Hide/Disable several (meaningless) options in Settings uber-page for Guest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Another merge Created 8 years, 9 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/options2/browser_options.js
diff --git a/chrome/browser/resources/options2/browser_options.js b/chrome/browser/resources/options2/browser_options.js
index 5c3bfd7765054ba55bc4d8b24710af5fe9da75d2..de7cde8343c1bb5c4171fbf8faf46981c7b353e5 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -77,6 +77,9 @@ cr.define('options', function() {
self.updateAdvancedSettingsExpander_();
});
+ if (cr.isChromeOS)
+ AccountsOptions.applyGuestModeVisibility(document);
+
// Sync (Sign in) section.
this.updateSyncState_(templateData.syncData);
@@ -224,24 +227,18 @@ cr.define('options', function() {
};
if (cr.isChromeOS) {
+ if (!AccountsOptions.loggedInAsGuest()) {
+ $('account-picture-wrapper').onclick = function(event) {
+ OptionsPage.navigateToPage('changePicture');
+ };
+ }
+
// Username (canonical email) of the currently logged in user or
// |kGuestUser| if a guest session is active.
this.username_ = localStrings.getString('username');
this.updateAccountPicture_();
- if (cr.commandLine && cr.commandLine.options['--bwsi']) {
- // Disable the screen lock checkbox in guest mode.
- $('enable-screen-lock').disabled = true;
-
- // Hide the startup section in Guest mode.
- $('startup-section').hidden = true;
- } else {
- $('account-picture-wrapper').onclick = function(event) {
- OptionsPage.navigateToPage('changePicture');
- };
- }
-
$('manage-accounts-button').onclick = function(event) {
OptionsPage.navigateToPage('accounts');
chrome.send('coreOptionsUserMetricsAction',
@@ -269,13 +266,6 @@ cr.define('options', function() {
$('auto-launch').onclick = this.handleAutoLaunchChanged_;
}
- // Date and time section (CrOS only).
- if (cr.isChromeOS && AccountsOptions.loggedInAsGuest()) {
- // Disable time-related settings if we're not logged in as a real user.
- $('timezone-select').disabled = true;
- $('use-24hour-clock').disabled = true;
- }
-
// Privacy section.
$('privacyContentSettingsButton').onclick = function(event) {
OptionsPage.navigateToPage('content');
@@ -342,7 +332,7 @@ cr.define('options', function() {
chrome.send('coreOptionsUserMetricsAction',
['Options_ShowPasswordManager']);
};
- if (this.guestModeActive_()) {
+ if (cr.isChromeOS && AccountsOptions.loggedInAsGuest()) {
// Disable and turn off Autofill in guest mode.
var autofillEnabled = $('autofill-enabled');
autofillEnabled.disabled = true;
@@ -356,10 +346,6 @@ cr.define('options', function() {
passwordManagerEnabled.checked = false;
cr.dispatchSimpleEvent(passwordManagerEnabled, 'change');
$('manage-passwords').disabled = true;
-
- // Hide the entire section on ChromeOS
- if (cr.isChromeOS)
- $('passwords-and-autofill-section').hidden = true;
}
if (cr.isMac)
@@ -968,16 +954,6 @@ cr.define('options', function() {
},
/**
- * Returns whether the browser in guest mode. Some features are disabled or
- * hidden in guest mode.
- * @return {boolean} True if guest mode is currently active.
- * @private
- */
- guestModeActive_: function() {
- return cr.commandLine && cr.commandLine.options['--bwsi'];
- },
-
- /**
* Set the font size selected item.
* @private
*/
@@ -1235,7 +1211,6 @@ cr.define('options', function() {
[
'addBluetoothDevice',
'getStartStopSyncButton',
- 'guestModeActive',
'hideBluetoothSettings',
'removeCloudPrintConnectorSection',
'removeBluetoothDevice',
« no previous file with comments | « chrome/browser/resources/options2/browser_options.html ('k') | chrome/browser/resources/options2/chromeos/accounts_options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698