diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-14 22:47:07 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-14 22:47:07 +0000 |
commit | 90a61c807f7162a4216984dda1a832abe12c52d3 (patch) | |
tree | c4db7727ff34eef7c3c8348b2ec177d8ea832f24 | |
parent | 0d70867304520439002cb899b457d3819f199604 (diff) | |
download | chromium_src-90a61c807f7162a4216984dda1a832abe12c52d3.zip chromium_src-90a61c807f7162a4216984dda1a832abe12c52d3.tar.gz chromium_src-90a61c807f7162a4216984dda1a832abe12c52d3.tar.bz2 |
Disable "Reset to Default Theme" button in Google Chrome Options / Personal Stuff when the default theme is already set, Windows side.
BUG= http://crbug.com/18585
TEST= Install a default theme, note that button is disabled. Install a non-default theme, note that button is enabled.
Review URL: http://codereview.chromium.org/279005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29050 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/options/content_page_view.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 69ec618..2f8efb0 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -204,6 +204,8 @@ void ContentPageView::InitControlLayout() { profile()->GetPrefs(), this); ask_to_save_form_autofill_.Init(prefs::kFormAutofillEnabled, profile()->GetPrefs(), this); + is_using_default_theme_.Init(prefs::kCurrentThemeID, + profile()->GetPrefs(), this); } void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { @@ -221,6 +223,10 @@ void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { form_autofill_neversave_radio_->SetChecked(true); } } + if (!pref_name || *pref_name == prefs::kCurrentThemeID) { + themes_reset_button_->SetEnabled( + is_using_default_theme_.GetValue().length() > 0); + } } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index 2b12a53..62133c0 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -109,6 +109,7 @@ class ContentPageView : public OptionsPageView, BooleanPrefMember ask_to_save_passwords_; BooleanPrefMember ask_to_save_form_autofill_; + StringPrefMember is_using_default_theme_; #ifdef CHROME_PERSONALIZATION // Cached pointer to ProfileSyncService, if it exists. Kept up to date |