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

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: No change picture button anymore 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..85e1676c72a06479a74993cf9e2b87b158819081 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -87,6 +87,14 @@ cr.define('options', function() {
$('themes-reset').onclick = function(event) {
chrome.send('themesReset');
};
+ if (cr.isChromeOS) {
+ if (AccountsOptions.loggedInAsGuest()) {
+ AccountsOptions.disableElementsForGuest(
+ $('toolbar-show-home-button-group'));
+ AccountsOptions.disableElementsForGuest(
+ $('bookmarkbar-show-on-all-tabs-group'));
+ }
+ }
// Device section (ChromeOS only).
if (cr.isChromeOS) {
@@ -103,6 +111,11 @@ cr.define('options', function() {
}
// Search section.
+ if (cr.isChromeOS) {
+ if (AccountsOptions.loggedInAsGuest())
James Hawkins 2012/02/28 20:03:35 Move this 'if' logic up.
Denis Kuznetsov (DE-MUC) 2012/02/29 08:41:43 Done.
+ AccountsOptions.disableElementsForGuest($('instant-setting'));
+ }
+
$('manage-default-search-engines').onclick = function(event) {
OptionsPage.navigateToPage('searchEngines');
chrome.send('coreOptionsUserMetricsAction',
@@ -172,6 +185,9 @@ cr.define('options', function() {
};
if (cr.isChromeOS) {
+ if (AccountsOptions.loggedInAsGuest())
+ $('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,11 +197,9 @@ 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;
+ if (AccountsOptions.loggedInAsGuest()) {
James Hawkins 2012/02/28 20:03:35 Move this block up to the top.
Denis Kuznetsov (DE-MUC) 2012/02/29 08:41:43 Done.
+ // Disable the screen lock checkbox in guest mode.
+ AccountsOptions.disableElementsForGuest($('enable-screen-lock'));
// Hide the startup section in Guest mode.
$('startup-section').hidden = true;

Powered by Google App Engine
This is Rietveld 408576698