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

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: Nit fixes + merge with TOT + gray out labels for disabled elements Created 8 years, 10 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 138a000ee994e5c6f44d4efb40f3f41198300556..7ac9c7f034e4ddf368d8f289cdb4bc4598fd26ce 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -99,6 +99,17 @@ cr.define('options', function() {
$('themes-reset').onclick = function(event) {
chrome.send('themesReset');
};
+ if (cr.isChromeOS) {
+ // Appearance section.
+ if (AccountsOptions.loggedInAsGuest()) {
+ AccountsOptions.disableElementsForGuest(
+ $('home-page-select-container'));
+ AccountsOptions.disableElementsForGuest(
+ $('bookmarkbar-show-on-all-tabs-group'));
+ // Search section
+ AccountsOptions.disableElementsForGuest($('instant-setting'));
+ }
+ }
// Device section (ChromeOS only).
if (cr.isChromeOS) {
@@ -183,24 +194,25 @@ cr.define('options', function() {
};
if (cr.isChromeOS) {
- // 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']) {
+ if (AccountsOptions.loggedInAsGuest()) {
// Disable the screen lock checkbox in guest mode.
- $('enable-screen-lock').disabled = true;
+ AccountsOptions.disableElementsForGuest($('enable-screen-lock'));
- // Hide the startup section in Guest mode.
+ // Hide the startup and users sections in Guest mode.
$('startup-section').hidden = true;
+ $('users-section').hidden = true;
} else {
$('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_();
+
$('manage-accounts-button').onclick = function(event) {
OptionsPage.navigateToPage('accounts');
chrome.send('coreOptionsUserMetricsAction',

Powered by Google App Engine
This is Rietveld 408576698