diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 23:49:36 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 23:49:36 +0000 |
commit | 7705e21ff5975c739d41765b031d8dcacf1ec6d1 (patch) | |
tree | a57cbb761e67d533052411298daf4f8af74f4975 | |
parent | 37154fd7914754f7e553e4375d1647ba80d70372 (diff) | |
download | chromium_src-7705e21ff5975c739d41765b031d8dcacf1ec6d1.zip chromium_src-7705e21ff5975c739d41765b031d8dcacf1ec6d1.tar.gz chromium_src-7705e21ff5975c739d41765b031d8dcacf1ec6d1.tar.bz2 |
Fix Chrome crashes when opening settings in guest mode on Chrome OS.
Along the way, hide the autofill options in guest mode as it does not
make sense for a guest user.
TEST=confirm that crash is fixed and the autofil options are hidden for the guest user on chrome os
BUG=chromium-os:20846
Review URL: http://codereview.chromium.org/8050026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103052 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/resources/options/personal_options.html b/chrome/browser/resources/options/personal_options.html index 0ab4e20..8c1c58c 100644 --- a/chrome/browser/resources/options/personal_options.html +++ b/chrome/browser/resources/options/personal_options.html @@ -81,7 +81,7 @@ </div> </div> </section> - <section> + <section id="autofill-section"> <h3 i18n-content="autofill"></h3> <div> <div class="checkbox"> diff --git a/chrome/browser/resources/options/personal_options.js b/chrome/browser/resources/options/personal_options.js index 5c2e382..c09b787 100644 --- a/chrome/browser/resources/options/personal_options.js +++ b/chrome/browser/resources/options/personal_options.js @@ -91,6 +91,10 @@ cr.define('options', function() { chrome.send('coreOptionsUserMetricsAction', ['Options_ShowAutofillSettings']); }; + if (cr.isChromeOS && cr.commandLine.options['--bwsi']) { + // Hide Autofill options for the guest user. + $('autofill-section').hidden = true; + } // Appearance. $('themes-reset').onclick = function(event) { diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc index f7004ef..1537b28 100644 --- a/chrome/browser/ui/webui/options/autofill_options_handler.cc +++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc @@ -284,9 +284,11 @@ void AutofillOptionsHandler::GetLocalizedValues( void AutofillOptionsHandler::Initialize() { personal_data_ = PersonalDataManagerFactory::GetForProfile( Profile::FromWebUI(web_ui_)); - personal_data_->SetObserver(this); - - LoadAutofillData(); + // personal_data_ is NULL in guest mode on Chrome OS. + if (personal_data_) { + personal_data_->SetObserver(this); + LoadAutofillData(); + } } void AutofillOptionsHandler::RegisterMessages() { |