| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/views/options/content_page_view.h" | 5 #include "chrome/browser/views/options/content_page_view.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 #include <vsstyle.h> | 9 #include <vsstyle.h> |
| 10 #include <vssym32.h> | 10 #include <vssym32.h> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 layout->StartRow(0, single_column_view_set_id); | 197 layout->StartRow(0, single_column_view_set_id); |
| 198 InitThemesGroup(); | 198 InitThemesGroup(); |
| 199 layout->AddView(themes_group_); | 199 layout->AddView(themes_group_); |
| 200 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 200 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 201 | 201 |
| 202 // Init member prefs so we can update the controls if prefs change. | 202 // Init member prefs so we can update the controls if prefs change. |
| 203 ask_to_save_passwords_.Init(prefs::kPasswordManagerEnabled, | 203 ask_to_save_passwords_.Init(prefs::kPasswordManagerEnabled, |
| 204 profile()->GetPrefs(), this); | 204 profile()->GetPrefs(), this); |
| 205 ask_to_save_form_autofill_.Init(prefs::kFormAutofillEnabled, | 205 ask_to_save_form_autofill_.Init(prefs::kFormAutofillEnabled, |
| 206 profile()->GetPrefs(), this); | 206 profile()->GetPrefs(), this); |
| 207 is_using_default_theme_.Init(prefs::kCurrentThemeID, |
| 208 profile()->GetPrefs(), this); |
| 207 } | 209 } |
| 208 | 210 |
| 209 void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { | 211 void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { |
| 210 if (!pref_name || *pref_name == prefs::kPasswordManagerEnabled) { | 212 if (!pref_name || *pref_name == prefs::kPasswordManagerEnabled) { |
| 211 if (ask_to_save_passwords_.GetValue()) { | 213 if (ask_to_save_passwords_.GetValue()) { |
| 212 passwords_asktosave_radio_->SetChecked(true); | 214 passwords_asktosave_radio_->SetChecked(true); |
| 213 } else { | 215 } else { |
| 214 passwords_neversave_radio_->SetChecked(true); | 216 passwords_neversave_radio_->SetChecked(true); |
| 215 } | 217 } |
| 216 } | 218 } |
| 217 if (!pref_name || *pref_name == prefs::kFormAutofillEnabled) { | 219 if (!pref_name || *pref_name == prefs::kFormAutofillEnabled) { |
| 218 if (ask_to_save_form_autofill_.GetValue()) { | 220 if (ask_to_save_form_autofill_.GetValue()) { |
| 219 form_autofill_asktosave_radio_->SetChecked(true); | 221 form_autofill_asktosave_radio_->SetChecked(true); |
| 220 } else { | 222 } else { |
| 221 form_autofill_neversave_radio_->SetChecked(true); | 223 form_autofill_neversave_radio_->SetChecked(true); |
| 222 } | 224 } |
| 223 } | 225 } |
| 226 if (!pref_name || *pref_name == prefs::kCurrentThemeID) { |
| 227 themes_reset_button_->SetEnabled( |
| 228 is_using_default_theme_.GetValue().length() > 0); |
| 229 } |
| 224 } | 230 } |
| 225 | 231 |
| 226 /////////////////////////////////////////////////////////////////////////////// | 232 /////////////////////////////////////////////////////////////////////////////// |
| 227 // ContentsPageView, views::View overrides: | 233 // ContentsPageView, views::View overrides: |
| 228 | 234 |
| 229 void ContentPageView::Layout() { | 235 void ContentPageView::Layout() { |
| 230 #ifdef CHROME_PERSONALIZATION | 236 #ifdef CHROME_PERSONALIZATION |
| 231 if (is_initialized()) | 237 if (is_initialized()) |
| 232 UpdateSyncControls(); | 238 UpdateSyncControls(); |
| 233 #endif | 239 #endif |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 if (status_has_error) { | 481 if (status_has_error) { |
| 476 sync_status_label_->set_background(CreateErrorBackground()); | 482 sync_status_label_->set_background(CreateErrorBackground()); |
| 477 sync_action_link_->set_background(CreateErrorBackground()); | 483 sync_action_link_->set_background(CreateErrorBackground()); |
| 478 } else { | 484 } else { |
| 479 sync_status_label_->set_background(NULL); | 485 sync_status_label_->set_background(NULL); |
| 480 sync_action_link_->set_background(NULL); | 486 sync_action_link_->set_background(NULL); |
| 481 } | 487 } |
| 482 } | 488 } |
| 483 | 489 |
| 484 #endif | 490 #endif |
| OLD | NEW |