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

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: Post-review fixes 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 280f7afe1c5758715b8ccb198af6bcc9da619c81..007982f606eafd2875185d9a96a0a6f1ed0034f8 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -87,6 +87,17 @@ cr.define('options', function() {
$('themes-reset').onclick = function(event) {
chrome.send('themesReset');
};
+ if (cr.isChromeOS) {
+ // // Appearance section.
csilv 2012/03/01 01:32:18 nit, extra // Perhaps we should combine the if bl
Denis Kuznetsov (DE-MUC) 2012/03/01 14:21:54 Done. I like the idea that all code is grouped ju
+ if (AccountsOptions.loggedInAsGuest()) {
+ AccountsOptions.disableElementsForGuest(
+ $('toolbar-show-home-button-group'));
+ AccountsOptions.disableElementsForGuest(
+ $('bookmarkbar-show-on-all-tabs-group'));
+ // Search section
+ AccountsOptions.disableElementsForGuest($('instant-setting'));
+ }
+ }
// Device section (ChromeOS only).
if (cr.isChromeOS) {
@@ -172,6 +183,15 @@ cr.define('options', function() {
};
if (cr.isChromeOS) {
+ if (AccountsOptions.loggedInAsGuest()) {
+ // Disable the screen lock checkbox in guest mode.
+ AccountsOptions.disableElementsForGuest($('enable-screen-lock'));
+
+ // Hide the startup and users sections in Guest mode.
+ $('startup-section').hidden = true;
+ $('users-section').hidden = true;
+ }
+
// Username (canonical email) of the currently logged in user or
// |kGuestUser| if a guest session is active.
this.username_ = localStrings.getString('username');
@@ -181,16 +201,6 @@ cr.define('options', function() {
};
this.updateAccountPicture_();
- if (cr.commandLine && cr.commandLine.options['--bwsi']) {
- // Disable the screen lock checkbox and change-picture-button in
- // guest mode.
- $('enable-screen-lock').disabled = true;
- $('change-picture-button').disabled = true;
-
- // Hide the startup section in Guest mode.
- $('startup-section').hidden = true;
- }
-
$('manage-accounts-button').onclick = function(event) {
OptionsPage.navigateToPage('accounts');
chrome.send('coreOptionsUserMetricsAction',

Powered by Google App Engine
This is Rietveld 408576698