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

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: Declarative way 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 b5dec20bcf582f1d40a7183c891dd5966f744816..40d62d1b514a5bce883c814fe7a929e3de9e9c12 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -66,6 +66,8 @@ cr.define('options', function() {
$('advanced-settings').addEventListener('webkitTransitionEnd',
this.advancedSettingsTransitionEnded_.bind(this));
+ AccountsOptions.applyGuestModeVisibility(document);
+
// Sync (Sign in) section.
this.updateSyncState_(templateData.syncData);
@@ -204,24 +206,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',
@@ -249,13 +245,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');
@@ -322,7 +311,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;
@@ -336,10 +325,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) {
@@ -966,16 +951,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
*/
@@ -1229,7 +1204,6 @@ cr.define('options', function() {
[
'addBluetoothDevice',
'getStartStopSyncButton',
- 'guestModeActive',
'hideBluetoothSettings',
'removeCloudPrintConnectorSection',
'removeBluetoothDevice',

Powered by Google App Engine
This is Rietveld 408576698