diff options
Diffstat (limited to 'chrome/browser/views/options')
-rw-r--r-- | chrome/browser/views/options/advanced_contents_view.cc | 140 | ||||
-rw-r--r-- | chrome/browser/views/options/advanced_page_view.cc | 7 | ||||
-rw-r--r-- | chrome/browser/views/options/advanced_page_view.h | 11 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.cc | 43 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.h | 15 | ||||
-rw-r--r-- | chrome/browser/views/options/cookies_view.cc | 14 | ||||
-rw-r--r-- | chrome/browser/views/options/cookies_view.h | 9 | ||||
-rw-r--r-- | chrome/browser/views/options/fonts_page_view.cc | 12 | ||||
-rw-r--r-- | chrome/browser/views/options/fonts_page_view.h | 9 | ||||
-rw-r--r-- | chrome/browser/views/options/general_page_view.cc | 50 | ||||
-rw-r--r-- | chrome/browser/views/options/general_page_view.h | 13 | ||||
-rw-r--r-- | chrome/browser/views/options/languages_page_view.cc | 24 | ||||
-rw-r--r-- | chrome/browser/views/options/languages_page_view.h | 13 |
13 files changed, 172 insertions, 188 deletions
diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index 45e0cc2..1f73219 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -98,7 +98,7 @@ class AdvancedSection : public OptionsPageView { // Convenience helpers for adding controls to specific layouts in an // aesthetically pleasing way. void AddWrappingCheckboxRow(views::GridLayout* layout, - views::CheckBox* checkbox, + views::Checkbox* checkbox, int id, bool related_follows); void AddWrappingLabelRow(views::GridLayout* layout, @@ -172,7 +172,7 @@ void AdvancedSection::AddWrappingColumnSet(views::GridLayout* layout, int id) { void AdvancedSection::AddDependentTwoColumnSet(views::GridLayout* layout, int id) { ColumnSet* column_set = layout->AddColumnSet(id); - column_set->AddPaddingColumn(0, views::CheckBox::GetTextIndent()); + column_set->AddPaddingColumn(0, views::Checkbox::GetTextIndent()); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); @@ -192,13 +192,13 @@ void AdvancedSection::AddTwoColumnSet(views::GridLayout* layout, int id) { void AdvancedSection::AddIndentedColumnSet(views::GridLayout* layout, int id) { ColumnSet* column_set = layout->AddColumnSet(id); - column_set->AddPaddingColumn(0, views::CheckBox::GetTextIndent()); + column_set->AddPaddingColumn(0, views::Checkbox::GetTextIndent()); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); } void AdvancedSection::AddWrappingCheckboxRow(views::GridLayout* layout, - views::CheckBox* checkbox, + views::Checkbox* checkbox, int id, bool related_follows) { checkbox->SetMultiLine(true); @@ -319,15 +319,15 @@ class CookieBehaviorComboModel : public views::ComboBox::Model { }; class PrivacySection : public AdvancedSection, - public views::NativeButton::Listener, + public views::ButtonListener, public views::ComboBox::Listener, public views::LinkController { public: explicit PrivacySection(Profile* profile); virtual ~PrivacySection() {} - // Overridden from views::NativeButton::Listener: - virtual void ButtonPressed(views::NativeButton* sender); + // Overridden from views::ButtonListener: + virtual void ButtonPressed(views::Button* sender); // Overridden from views::ComboBox::Listener: virtual void ItemChanged(views::ComboBox* sender, @@ -348,11 +348,11 @@ class PrivacySection : public AdvancedSection, private: // Controls for this section: views::Label* section_description_label_; - views::CheckBox* enable_link_doctor_checkbox_; - views::CheckBox* enable_suggest_checkbox_; - views::CheckBox* enable_dns_prefetching_checkbox_; - views::CheckBox* enable_safe_browsing_checkbox_; - views::CheckBox* reporting_enabled_checkbox_; + views::Checkbox* enable_link_doctor_checkbox_; + views::Checkbox* enable_suggest_checkbox_; + views::Checkbox* enable_dns_prefetching_checkbox_; + views::Checkbox* enable_safe_browsing_checkbox_; + views::Checkbox* reporting_enabled_checkbox_; views::Link* learn_more_link_; views::Label* cookie_behavior_label_; views::ComboBox* cookie_behavior_combobox_; @@ -389,23 +389,23 @@ PrivacySection::PrivacySection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY)) { } -void PrivacySection::ButtonPressed(views::NativeButton* sender) { +void PrivacySection::ButtonPressed(views::Button* sender) { if (sender == enable_link_doctor_checkbox_) { - bool enabled = enable_link_doctor_checkbox_->IsSelected(); + bool enabled = enable_link_doctor_checkbox_->checked(); UserMetricsRecordAction(enabled ? L"Options_LinkDoctorCheckbox_Enable" : L"Options_LinkDoctorCheckbox_Disable", profile()->GetPrefs()); alternate_error_pages_.SetValue(enabled); } else if (sender == enable_suggest_checkbox_) { - bool enabled = enable_suggest_checkbox_->IsSelected(); + bool enabled = enable_suggest_checkbox_->checked(); UserMetricsRecordAction(enabled ? L"Options_UseSuggestCheckbox_Enable" : L"Options_UseSuggestCheckbox_Disable", profile()->GetPrefs()); use_suggest_.SetValue(enabled); } else if (sender == enable_dns_prefetching_checkbox_) { - bool enabled = enable_dns_prefetching_checkbox_->IsSelected(); + bool enabled = enable_dns_prefetching_checkbox_->checked(); UserMetricsRecordAction(enabled ? L"Options_DnsPrefetchCheckbox_Enable" : L"Options_DnsPrefetchCheckbox_Disable", @@ -413,7 +413,7 @@ void PrivacySection::ButtonPressed(views::NativeButton* sender) { dns_prefetch_enabled_.SetValue(enabled); chrome_browser_net::EnableDnsPrefetch(enabled); } else if (sender == enable_safe_browsing_checkbox_) { - bool enabled = enable_safe_browsing_checkbox_->IsSelected(); + bool enabled = enable_safe_browsing_checkbox_->checked(); UserMetricsRecordAction(enabled ? L"Options_SafeBrowsingCheckbox_Enable" : L"Options_SafeBrowsingCheckbox_Disable", @@ -424,13 +424,13 @@ void PrivacySection::ButtonPressed(views::NativeButton* sender) { MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( safe_browsing_service, &SafeBrowsingService::OnEnable, enabled)); } else if (sender == reporting_enabled_checkbox_) { - bool enabled = reporting_enabled_checkbox_->IsSelected(); + bool enabled = reporting_enabled_checkbox_->checked(); UserMetricsRecordAction(enabled ? L"Options_MetricsReportingCheckbox_Enable" : L"Options_MetricsReportingCheckbox_Disable", profile()->GetPrefs()); ResolveMetricsReportingEnabled(); - if (enabled == reporting_enabled_checkbox_->IsSelected()) + if (enabled == reporting_enabled_checkbox_->checked()) RestartMessageBox::ShowMessageBox(GetRootWindow()); enable_metrics_recording_.SetValue(enabled); } else if (sender == show_cookies_button_) { @@ -485,22 +485,22 @@ void PrivacySection::InitControlLayout() { section_description_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_DISABLE_SERVICES)); - enable_link_doctor_checkbox_ = new views::CheckBox( + enable_link_doctor_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_LINKDOCTOR_PREF)); - enable_link_doctor_checkbox_->SetListener(this); - enable_suggest_checkbox_ = new views::CheckBox( + enable_link_doctor_checkbox_->set_listener(this); + enable_suggest_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_SUGGEST_PREF)); - enable_suggest_checkbox_->SetListener(this); - enable_dns_prefetching_checkbox_ = new views::CheckBox( + enable_suggest_checkbox_->set_listener(this); + enable_dns_prefetching_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_NETWORK_DNS_PREFETCH_ENABLED_DESCRIPTION)); - enable_dns_prefetching_checkbox_->SetListener(this); - enable_safe_browsing_checkbox_ = new views::CheckBox( + enable_dns_prefetching_checkbox_->set_listener(this); + enable_safe_browsing_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION)); - enable_safe_browsing_checkbox_->SetListener(this); - reporting_enabled_checkbox_ = new views::CheckBox( + enable_safe_browsing_checkbox_->set_listener(this); + reporting_enabled_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_ENABLE_LOGGING)); reporting_enabled_checkbox_->SetMultiLine(true); - reporting_enabled_checkbox_->SetListener(this); + reporting_enabled_checkbox_->set_listener(this); learn_more_link_ = new views::Link(l10n_util::GetString(IDS_LEARN_MORE)); learn_more_link_->SetController(this); cookie_behavior_label_ = new views::Label( @@ -510,8 +510,7 @@ void PrivacySection::InitControlLayout() { allow_cookies_model_.get()); cookie_behavior_combobox_->SetListener(this); show_cookies_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_COOKIES_SHOWCOOKIES)); - show_cookies_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_COOKIES_SHOWCOOKIES)); GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); @@ -571,21 +570,21 @@ void PrivacySection::InitControlLayout() { void PrivacySection::NotifyPrefChanged(const std::wstring* pref_name) { if (!pref_name || *pref_name == prefs::kAlternateErrorPagesEnabled) { - enable_link_doctor_checkbox_->SetIsSelected( + enable_link_doctor_checkbox_->SetChecked( alternate_error_pages_.GetValue()); } if (!pref_name || *pref_name == prefs::kSearchSuggestEnabled) { - enable_suggest_checkbox_->SetIsSelected(use_suggest_.GetValue()); + enable_suggest_checkbox_->SetChecked(use_suggest_.GetValue()); } if (!pref_name || *pref_name == prefs::kDnsPrefetchingEnabled) { bool enabled = dns_prefetch_enabled_.GetValue(); - enable_dns_prefetching_checkbox_->SetIsSelected(enabled); + enable_dns_prefetching_checkbox_->SetChecked(enabled); chrome_browser_net::EnableDnsPrefetch(enabled); } if (!pref_name || *pref_name == prefs::kSafeBrowsingEnabled) - enable_safe_browsing_checkbox_->SetIsSelected(safe_browsing_.GetValue()); + enable_safe_browsing_checkbox_->SetChecked(safe_browsing_.GetValue()); if (!pref_name || *pref_name == prefs::kMetricsReportingEnabled) { - reporting_enabled_checkbox_->SetIsSelected( + reporting_enabled_checkbox_->SetChecked( enable_metrics_recording_.GetValue()); ResolveMetricsReportingEnabled(); } @@ -597,7 +596,7 @@ void PrivacySection::NotifyPrefChanged(const std::wstring* pref_name) { } void PrivacySection::ResolveMetricsReportingEnabled() { - bool enabled = reporting_enabled_checkbox_->IsSelected(); + bool enabled = reporting_enabled_checkbox_->checked(); GoogleUpdateSettings::SetCollectStatsConsent(enabled); bool update_pref = GoogleUpdateSettings::GetCollectStatsConsent(); @@ -622,20 +621,20 @@ void PrivacySection::ResolveMetricsReportingEnabled() { metrics->Stop(); } - reporting_enabled_checkbox_->SetIsSelected(enabled); + reporting_enabled_checkbox_->SetChecked(enabled); } //////////////////////////////////////////////////////////////////////////////// // WebContentSection class WebContentSection : public AdvancedSection, - public views::NativeButton::Listener { + public views::ButtonListener { public: explicit WebContentSection(Profile* profile); virtual ~WebContentSection() {} - // Overridden from views::NativeButton::Listener: - virtual void ButtonPressed(views::NativeButton* sender); + // Overridden from views::ButtonListener: + virtual void ButtonPressed(views::Button* sender); protected: // OptionsPageView overrides: @@ -644,7 +643,7 @@ class WebContentSection : public AdvancedSection, private: // Controls for this section: - views::CheckBox* popup_blocked_notification_checkbox_; + views::Checkbox* popup_blocked_notification_checkbox_; views::Label* gears_label_; views::NativeButton* gears_settings_button_; @@ -661,10 +660,10 @@ WebContentSection::WebContentSection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT)) { } -void WebContentSection::ButtonPressed(views::NativeButton* sender) { +void WebContentSection::ButtonPressed(views::Button* sender) { if (sender == popup_blocked_notification_checkbox_) { bool notification_disabled = - popup_blocked_notification_checkbox_->IsSelected(); + popup_blocked_notification_checkbox_->checked(); if (notification_disabled) { UserMetricsRecordAction(L"Options_BlockAllPopups_Disable", profile()->GetPrefs()); @@ -682,9 +681,9 @@ void WebContentSection::ButtonPressed(views::NativeButton* sender) { void WebContentSection::InitControlLayout() { AdvancedSection::InitControlLayout(); - popup_blocked_notification_checkbox_ = new views::CheckBox( + popup_blocked_notification_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_SHOWPOPUPBLOCKEDNOTIFICATION)); - popup_blocked_notification_checkbox_->SetListener(this); + popup_blocked_notification_checkbox_->set_listener(this); if (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) { gears_label_ = new views::Label( @@ -699,8 +698,8 @@ void WebContentSection::InitControlLayout() { gears_label_ = new views::Label(gearssetting_group_name); } gears_settings_button_ = new views::NativeButton( + this, l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_CONFIGUREGEARS_BUTTON)); - gears_settings_button_->SetListener(this); GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); @@ -722,7 +721,7 @@ void WebContentSection::InitControlLayout() { void WebContentSection::NotifyPrefChanged(const std::wstring* pref_name) { if (!pref_name || *pref_name == prefs::kBlockPopups) { - popup_blocked_notification_checkbox_->SetIsSelected( + popup_blocked_notification_checkbox_->SetChecked( !disable_popup_blocked_notification_pref_.GetValue()); } } @@ -769,14 +768,14 @@ class MixedContentComboModel : public views::ComboBox::Model { }; class SecuritySection : public AdvancedSection, - public views::NativeButton::Listener, + public views::ButtonListener, public views::ComboBox::Listener { public: explicit SecuritySection(Profile* profile); virtual ~SecuritySection() {} - // Overridden from views::NativeButton::Listener: - virtual void ButtonPressed(views::NativeButton* sender); + // Overridden from views::ButtonListener: + virtual void ButtonPressed(views::Button* sender); // Overridden from views::ComboBox::Listener: virtual void ItemChanged(views::ComboBox* sender, @@ -793,8 +792,8 @@ class SecuritySection : public AdvancedSection, views::Label* reset_file_handlers_label_; views::NativeButton* reset_file_handlers_button_; views::Label* ssl_info_label_; - views::CheckBox* enable_ssl2_checkbox_; - views::CheckBox* check_for_cert_revocation_checkbox_; + views::Checkbox* enable_ssl2_checkbox_; + views::Checkbox* check_for_cert_revocation_checkbox_; views::Label* mixed_content_info_label_; views::ComboBox* mixed_content_combobox_; views::Label* manage_certificates_label_; @@ -823,13 +822,13 @@ SecuritySection::SecuritySection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY)) { } -void SecuritySection::ButtonPressed(views::NativeButton* sender) { +void SecuritySection::ButtonPressed(views::Button* sender) { if (sender == reset_file_handlers_button_) { profile()->GetDownloadManager()->ResetAutoOpenFiles(); UserMetricsRecordAction(L"Options_ResetAutoOpenFiles", profile()->GetPrefs()); } else if (sender == enable_ssl2_checkbox_) { - bool enabled = enable_ssl2_checkbox_->IsSelected(); + bool enabled = enable_ssl2_checkbox_->checked(); if (enabled) { UserMetricsRecordAction(L"Options_SSL2_Enable", NULL); } else { @@ -837,7 +836,7 @@ void SecuritySection::ButtonPressed(views::NativeButton* sender) { } net::SSLConfigService::SetSSL2Enabled(enabled); } else if (sender == check_for_cert_revocation_checkbox_) { - bool enabled = check_for_cert_revocation_checkbox_->IsSelected(); + bool enabled = check_for_cert_revocation_checkbox_->checked(); if (enabled) { UserMetricsRecordAction(L"Options_CheckCertRevocation_Enable", NULL); } else { @@ -878,16 +877,15 @@ void SecuritySection::InitControlLayout() { reset_file_handlers_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_AUTOOPENFILETYPES_INFO)); reset_file_handlers_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_AUTOOPENFILETYPES_RESETTODEFAULT)); - reset_file_handlers_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_AUTOOPENFILETYPES_RESETTODEFAULT)); ssl_info_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_SSL_GROUP_DESCRIPTION)); - enable_ssl2_checkbox_ = new views::CheckBox( + enable_ssl2_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_SSL_USESSL2)); - enable_ssl2_checkbox_->SetListener(this); - check_for_cert_revocation_checkbox_ = new views::CheckBox( + enable_ssl2_checkbox_->set_listener(this); + check_for_cert_revocation_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_SSL_CHECKREVOCATION)); - check_for_cert_revocation_checkbox_->SetListener(this); + check_for_cert_revocation_checkbox_->set_listener(this); mixed_content_info_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_MIXED_CONTENT_LABEL)); mixed_content_model_.reset(new MixedContentComboModel); @@ -897,8 +895,7 @@ void SecuritySection::InitControlLayout() { manage_certificates_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_LABEL)); manage_certificates_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_MANAGE_BUTTON)); - manage_certificates_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_MANAGE_BUTTON)); GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); @@ -962,8 +959,8 @@ void SecuritySection::NotifyPrefChanged(const std::wstring* pref_name) { if (!pref_name) { net::SSLConfig config; if (net::SSLConfigService::GetSSLConfigNow(&config)) { - enable_ssl2_checkbox_->SetIsSelected(config.ssl2_enabled); - check_for_cert_revocation_checkbox_->SetIsSelected( + enable_ssl2_checkbox_->SetChecked(config.ssl2_enabled); + check_for_cert_revocation_checkbox_->SetChecked( config.rev_checking_enabled); } else { enable_ssl2_checkbox_->SetEnabled(false); @@ -1014,13 +1011,13 @@ class OpenConnectionDialogTask : public Task { } // namespace class NetworkSection : public AdvancedSection, - public views::NativeButton::Listener { + public views::ButtonListener { public: explicit NetworkSection(Profile* profile); virtual ~NetworkSection() {} - // Overridden from views::NativeButton::Listener: - virtual void ButtonPressed(views::NativeButton* sender); + // Overridden from views::ButtonListener: + virtual void ButtonPressed(views::Button* sender); protected: // OptionsPageView overrides: @@ -1042,7 +1039,7 @@ NetworkSection::NetworkSection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK)) { } -void NetworkSection::ButtonPressed(views::NativeButton* sender) { +void NetworkSection::ButtonPressed(views::Button* sender) { if (sender == change_proxies_button_) { UserMetricsRecordAction(L"Options_ChangeProxies", NULL); base::Thread* thread = g_browser_process->file_thread(); @@ -1057,8 +1054,7 @@ void NetworkSection::InitControlLayout() { change_proxies_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_PROXIES_LABEL)); change_proxies_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON)); - change_proxies_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON)); GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); diff --git a/chrome/browser/views/options/advanced_page_view.cc b/chrome/browser/views/options/advanced_page_view.cc index 9e9f1e3..fc258f6 100644 --- a/chrome/browser/views/options/advanced_page_view.cc +++ b/chrome/browser/views/options/advanced_page_view.cc @@ -152,9 +152,9 @@ void AdvancedPageView::ResetToDefaults() { } /////////////////////////////////////////////////////////////////////////////// -// AdvancedPageView, views::NativeButton::Listener implementation: +// AdvancedPageView, views::ButtonListener implementation: -void AdvancedPageView::ButtonPressed(views::NativeButton* sender) { +void AdvancedPageView::ButtonPressed(views::Button* sender) { if (sender == reset_to_default_button_) { UserMetricsRecordAction(L"Options_ResetToDefaults", NULL); ResetDefaultsConfirmBox::ShowConfirmBox(GetRootWindow(), this); @@ -166,8 +166,7 @@ void AdvancedPageView::ButtonPressed(views::NativeButton* sender) { void AdvancedPageView::InitControlLayout() { reset_to_default_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_RESET)); - reset_to_default_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_RESET)); advanced_scroll_view_ = new AdvancedScrollViewContainer(profile()); using views::GridLayout; diff --git a/chrome/browser/views/options/advanced_page_view.h b/chrome/browser/views/options/advanced_page_view.h index 54aa8a1..1a9119e 100644 --- a/chrome/browser/views/options/advanced_page_view.h +++ b/chrome/browser/views/options/advanced_page_view.h @@ -6,17 +6,20 @@ #define CHROME_BROWSER_VIEWS_OPTIONS_ADVANCED_PAGE_VIEW_H_ #include "chrome/browser/views/options/options_page_view.h" -#include "chrome/views/controls/button/native_button.h" +#include "chrome/views/controls/button/button.h" class AdvancedOptionsListModel; class AdvancedScrollViewContainer; class PrefService; +namespace views { +class NativeButton; +} /////////////////////////////////////////////////////////////////////////////// // AdvancedPageView class AdvancedPageView : public OptionsPageView, - public views::NativeButton::Listener { + public views::ButtonListener { public: explicit AdvancedPageView(Profile* profile); virtual ~AdvancedPageView(); @@ -24,8 +27,8 @@ class AdvancedPageView : public OptionsPageView, // Resets all prefs to their default values. void ResetToDefaults(); - // views::NativeButton::Listener implementation: - virtual void ButtonPressed(views::NativeButton* sender); + // views::ButtonListener implementation: + virtual void ButtonPressed(views::Button* sender); protected: // OptionsPageView implementation: diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 18a7550..e6d6e40 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -23,8 +23,6 @@ #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" -#include "chrome/views/controls/button/checkbox.h" -#include "chrome/views/controls/button/native_button.h" #include "chrome/views/controls/button/radio_button.h" #include "chrome/views/controls/text_field.h" #include "chrome/views/grid_layout.h" @@ -207,9 +205,9 @@ void ContentPageView::FileSelected(const std::wstring& path, void* params) { } /////////////////////////////////////////////////////////////////////////////// -// ContentPageView, views::NativeButton::Listener implementation: +// ContentPageView, views::ButtonListener implementation: -void ContentPageView::ButtonPressed(views::NativeButton* sender) { +void ContentPageView::ButtonPressed(views::Button* sender) { if (sender == download_browse_button_) { const std::wstring dialog_title = l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE); @@ -221,7 +219,7 @@ void ContentPageView::ButtonPressed(views::NativeButton* sender) { GetRootWindow(), NULL); } else if (sender == download_ask_for_save_location_checkbox_) { - bool enabled = download_ask_for_save_location_checkbox_->IsSelected(); + bool enabled = download_ask_for_save_location_checkbox_->checked(); if (enabled) { UserMetricsRecordAction(L"Options_AskForSaveLocation_Enable", profile()->GetPrefs()); @@ -232,7 +230,7 @@ void ContentPageView::ButtonPressed(views::NativeButton* sender) { ask_for_save_location_.SetValue(enabled); } else if (sender == passwords_asktosave_radio_ || sender == passwords_neversave_radio_) { - bool enabled = passwords_asktosave_radio_->IsSelected(); + bool enabled = passwords_asktosave_radio_->checked(); if (enabled) { UserMetricsRecordAction(L"Options_PasswordManager_Enable", profile()->GetPrefs()); @@ -248,7 +246,7 @@ void ContentPageView::ButtonPressed(views::NativeButton* sender) { UserMetricsRecordAction(L"Options_ShowPasswordManager", NULL); PasswordManagerView::Show(profile()); } else if (sender == form_autofill_checkbox_) { - bool enabled = form_autofill_checkbox_->IsSelected(); + bool enabled = form_autofill_checkbox_->checked(); if (enabled) { UserMetricsRecordAction(L"Options_FormAutofill_Enable", profile()->GetPrefs()); @@ -319,18 +317,18 @@ void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { UpdateDownloadDirectoryDisplay(); if (!pref_name || *pref_name == prefs::kPromptForDownload) { - download_ask_for_save_location_checkbox_->SetIsSelected( + download_ask_for_save_location_checkbox_->SetChecked( ask_for_save_location_.GetValue()); } if (!pref_name || *pref_name == prefs::kPasswordManagerEnabled) { if (ask_to_save_passwords_.GetValue()) { - passwords_asktosave_radio_->SetIsSelected(true); + passwords_asktosave_radio_->SetChecked(true); } else { - passwords_neversave_radio_->SetIsSelected(true); + passwords_neversave_radio_->SetChecked(true); } } if (!pref_name || *pref_name == prefs::kFormAutofillEnabled) { - form_autofill_checkbox_->SetIsSelected(form_autofill_.GetValue()); + form_autofill_checkbox_->SetChecked(form_autofill_.GetValue()); } } @@ -358,12 +356,11 @@ void ContentPageView::Layout() { void ContentPageView::InitDownloadLocation() { download_default_download_location_display_ = new FileDisplayArea; download_browse_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_BUTTON)); - download_browse_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_BUTTON)); - download_ask_for_save_location_checkbox_ = new views::CheckBox( + download_ask_for_save_location_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION)); - download_ask_for_save_location_checkbox_->SetListener(this); + download_ask_for_save_location_checkbox_->set_listener(this); download_ask_for_save_location_checkbox_->SetMultiLine(true); using views::GridLayout; @@ -407,19 +404,17 @@ void ContentPageView::InitPasswordSavingGroup() { passwords_asktosave_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_PASSWORDS_ASKTOSAVE), kPasswordSavingRadioGroup); - passwords_asktosave_radio_->SetListener(this); + passwords_asktosave_radio_->set_listener(this); passwords_asktosave_radio_->SetMultiLine(true); passwords_neversave_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_PASSWORDS_NEVERSAVE), kPasswordSavingRadioGroup); - passwords_neversave_radio_->SetListener(this); + passwords_neversave_radio_->set_listener(this); passwords_neversave_radio_->SetMultiLine(true); passwords_show_passwords_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_PASSWORDS_SHOWPASSWORDS)); - passwords_show_passwords_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_PASSWORDS_SHOWPASSWORDS)); passwords_exceptions_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_PASSWORDS_EXCEPTIONS)); - passwords_exceptions_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_PASSWORDS_EXCEPTIONS)); using views::GridLayout; using views::ColumnSet; @@ -457,9 +452,9 @@ void ContentPageView::InitPasswordSavingGroup() { } void ContentPageView::InitFormAutofillGroup() { - form_autofill_checkbox_ = new views::CheckBox( + form_autofill_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_AUTOFILL_SAVEFORMS)); - form_autofill_checkbox_->SetListener(this); + form_autofill_checkbox_->set_listener(this); form_autofill_checkbox_->SetMultiLine(true); using views::GridLayout; @@ -488,8 +483,8 @@ void ContentPageView::InitFontsLangGroup() { fonts_and_languages_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); fonts_and_languages_label_->SetMultiLine(true); change_content_fonts_button_ = new views::NativeButton( + this, l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_CONFIGUREFONTS_BUTTON)); - change_content_fonts_button_->SetListener(this); using views::GridLayout; using views::ColumnSet; diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index 3d68bb5..508b568 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -8,11 +8,12 @@ #include "chrome/browser/views/options/options_page_view.h" #include "chrome/browser/shell_dialogs.h" #include "chrome/common/pref_member.h" -#include "chrome/views/controls/button/native_button.h" +#include "chrome/views/controls/button/button.h" #include "chrome/views/view.h" namespace views { -class CheckBox; +class Checkbox; +class NativeButton; class RadioButton; } class FileDisplayArea; @@ -23,14 +24,14 @@ class PrefService; // ContentPageView class ContentPageView : public OptionsPageView, - public views::NativeButton::Listener, + public views::ButtonListener, public SelectFileDialog::Listener { public: explicit ContentPageView(Profile* profile); virtual ~ContentPageView(); - // views::NativeButton::Listener implementation: - virtual void ButtonPressed(views::NativeButton* sender); + // views::ButtonListener implementation: + virtual void ButtonPressed(views::Button* sender); // SelectFileDialog::Listener implementation: virtual void FileSelected(const std::wstring& path, void* params); @@ -61,7 +62,7 @@ class ContentPageView : public OptionsPageView, OptionsGroupView* download_location_group_; FileDisplayArea* download_default_download_location_display_; views::NativeButton* download_browse_button_; - views::CheckBox* download_ask_for_save_location_checkbox_; + views::Checkbox* download_ask_for_save_location_checkbox_; scoped_refptr<SelectFileDialog> select_file_dialog_; // Controls for the Password Saving group @@ -73,7 +74,7 @@ class ContentPageView : public OptionsPageView, // Controls for the Form Autofill group OptionsGroupView* form_autofill_group_; - views::CheckBox* form_autofill_checkbox_; + views::Checkbox* form_autofill_checkbox_; // Controls for the Popup Blocking group. OptionsGroupView* popups_group_; diff --git a/chrome/browser/views/options/cookies_view.cc b/chrome/browser/views/options/cookies_view.cc index e31fc1e0..2bdc149 100644 --- a/chrome/browser/views/options/cookies_view.cc +++ b/chrome/browser/views/options/cookies_view.cc @@ -18,6 +18,7 @@ #include "chrome/views/border.h" #include "chrome/views/grid_layout.h" #include "chrome/views/controls/label.h" +#include "chrome/views/controls/button/native_button.h" #include "chrome/views/controls/text_field.h" #include "chrome/views/controls/table/table_view.h" #include "grit/generated_resources.h" @@ -571,9 +572,9 @@ void CookiesView::UpdateSearchResults() { } /////////////////////////////////////////////////////////////////////////////// -// CookiesView, views::NativeButton::listener implementation: +// CookiesView, views::Buttonlistener implementation: -void CookiesView::ButtonPressed(views::NativeButton* sender) { +void CookiesView::ButtonPressed(views::Button* sender) { if (sender == remove_button_) { cookies_table_->RemoveSelectedCookies(); } else if (sender == remove_all_button_) { @@ -704,8 +705,7 @@ void CookiesView::Init() { search_field_ = new views::TextField; search_field_->SetController(this); clear_search_button_ = new views::NativeButton( - l10n_util::GetString(IDS_COOKIES_CLEAR_SEARCH_LABEL)); - clear_search_button_->SetListener(this); + this, l10n_util::GetString(IDS_COOKIES_CLEAR_SEARCH_LABEL)); description_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_INFO_LABEL)); description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); @@ -728,11 +728,9 @@ void CookiesView::Init() { true)); cookies_table_->SetSortDescriptors(sort); remove_button_ = new views::NativeButton( - l10n_util::GetString(IDS_COOKIES_REMOVE_LABEL)); - remove_button_->SetListener(this); + this, l10n_util::GetString(IDS_COOKIES_REMOVE_LABEL)); remove_all_button_ = new views::NativeButton( - l10n_util::GetString(IDS_COOKIES_REMOVE_ALL_LABEL)); - remove_all_button_->SetListener(this); + this, l10n_util::GetString(IDS_COOKIES_REMOVE_ALL_LABEL)); using views::GridLayout; using views::ColumnSet; diff --git a/chrome/browser/views/options/cookies_view.h b/chrome/browser/views/options/cookies_view.h index 1c6aacc..ab8b213 100644 --- a/chrome/browser/views/options/cookies_view.h +++ b/chrome/browser/views/options/cookies_view.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H__ #include "base/task.h" -#include "chrome/views/controls/button/native_button.h" +#include "chrome/views/controls/button/button.h" #include "chrome/views/controls/table/table_view.h" #include "chrome/views/controls/text_field.h" #include "chrome/views/view.h" @@ -15,6 +15,7 @@ namespace views { class Label; +class NativeButton; } class CookieInfoView; class CookiesTableModel; @@ -24,7 +25,7 @@ class Timer; class CookiesView : public views::View, public views::DialogDelegate, - public views::NativeButton::Listener, + public views::ButtonListener, public views::TableViewObserver, public views::TextField::Controller { public: @@ -36,8 +37,8 @@ class CookiesView : public views::View, // Updates the display to show only the search results. void UpdateSearchResults(); - // views::NativeButton::Listener implementation: - virtual void ButtonPressed(views::NativeButton* sender); + // views::ButtonListener implementation: + virtual void ButtonPressed(views::Button* sender); // views::TableViewObserver implementation: virtual void OnSelectionChanged(); diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc index d33b23c..7433a65 100644 --- a/chrome/browser/views/options/fonts_page_view.cc +++ b/chrome/browser/views/options/fonts_page_view.cc @@ -24,9 +24,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" -#include "chrome/views/controls/button/checkbox.h" #include "chrome/views/controls/button/native_button.h" -#include "chrome/views/controls/button/radio_button.h" #include "chrome/views/controls/text_field.h" #include "chrome/views/grid_layout.h" #include "chrome/views/widget/widget.h" @@ -244,7 +242,7 @@ FontsPageView::FontsPageView(Profile* profile) FontsPageView::~FontsPageView() { } -void FontsPageView::ButtonPressed(views::NativeButton* sender) { +void FontsPageView::ButtonPressed(views::Button* sender) { HWND owning_hwnd = GetAncestor(GetWidget()->GetNativeView(), GA_ROOT); std::wstring font_name; int font_size = 0; @@ -375,9 +373,9 @@ void FontsPageView::InitFontLayout() { // Fixed width. fixed_width_font_display_view_ = new FontDisplayView; fixed_width_font_change_page_button_ = new views::NativeButton( + this, l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_BUTTON_LABEL)); - fixed_width_font_change_page_button_->SetListener(this); fixed_width_font_label_ = new views::Label( l10n_util::GetString( @@ -388,9 +386,9 @@ void FontsPageView::InitFontLayout() { // Serif font. serif_font_display_view_ = new FontDisplayView; serif_font_change_page_button_ = new views::NativeButton( + this, l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_BUTTON_LABEL)); - serif_font_change_page_button_->SetListener(this); serif_font_label_ = new views::Label( l10n_util::GetString( @@ -401,10 +399,10 @@ void FontsPageView::InitFontLayout() { // Sans Serif font. sans_serif_font_display_view_ = new FontDisplayView; sans_serif_font_change_page_button_ = new views::NativeButton( + this, l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_BUTTON_LABEL)); - sans_serif_font_change_page_button_->SetListener(this); - + sans_serif_font_label_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SANS_SERIF_LABEL)); diff --git a/chrome/browser/views/options/fonts_page_view.h b/chrome/browser/views/options/fonts_page_view.h index eb348e6..28f5f91 100644 --- a/chrome/browser/views/options/fonts_page_view.h +++ b/chrome/browser/views/options/fonts_page_view.h @@ -9,13 +9,14 @@ #include "chrome/browser/shell_dialogs.h" #include "chrome/common/pref_member.h" #include "chrome/views/controls/combo_box.h" -#include "chrome/views/controls/button/native_button.h" +#include "chrome/views/controls/button/button.h" #include "chrome/views/view.h" namespace views { class GroupboxView; class Label; +class NativeButton; class TableModel; class TableView; } @@ -29,13 +30,13 @@ class DefaultEncodingComboboxModel; class FontsPageView : public OptionsPageView, public views::ComboBox::Listener, public SelectFontDialog::Listener, - public views::NativeButton::Listener { + public views::ButtonListener { public: explicit FontsPageView(Profile* profile); virtual ~FontsPageView(); - // views::NativeButton::Listener implementation: - virtual void ButtonPressed(views::NativeButton* sender); + // views::ButtonListener implementation: + virtual void ButtonPressed(views::Button* sender); // views::ComboBox::Listener implementation: virtual void ItemChanged(views::ComboBox* combo_box, diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc index af3e9bd..564aef1 100644 --- a/chrome/browser/views/options/general_page_view.cc +++ b/chrome/browser/views/options/general_page_view.cc @@ -29,7 +29,6 @@ #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/url_constants.h" -#include "chrome/views/controls/button/checkbox.h" #include "chrome/views/controls/button/radio_button.h" #include "chrome/views/controls/label.h" #include "chrome/views/controls/table/table_view.h" @@ -536,9 +535,9 @@ GeneralPageView::~GeneralPageView() { } /////////////////////////////////////////////////////////////////////////////// -// GeneralPageView, views::NativeButton::Listener implementation: +// GeneralPageView, views::ButtonListener implementation: -void GeneralPageView::ButtonPressed(views::NativeButton* sender) { +void GeneralPageView::ButtonPressed(views::Button* sender) { if (sender == startup_homepage_radio_ || sender == startup_last_session_radio_ || sender == startup_custom_radio_) { @@ -570,7 +569,7 @@ void GeneralPageView::ButtonPressed(views::NativeButton* sender) { SetHomepage(homepage_use_url_textfield_->GetText()); EnableHomepageURLField(true); } else if (sender == homepage_show_home_button_checkbox_) { - bool show_button = homepage_show_home_button_checkbox_->IsSelected(); + bool show_button = homepage_show_home_button_checkbox_->checked(); if (show_button) { UserMetricsRecordAction(L"Options_Homepage_ShowHomeButton", profile()->GetPrefs()); @@ -673,17 +672,17 @@ void GeneralPageView::NotifyPrefChanged(const std::wstring* pref_name) { SessionStartupPref::GetStartupPref(prefs); switch (startup_pref.type) { case SessionStartupPref::DEFAULT: - startup_homepage_radio_->SetIsSelected(true); + startup_homepage_radio_->SetChecked(true); EnableCustomHomepagesControls(false); break; case SessionStartupPref::LAST: - startup_last_session_radio_->SetIsSelected(true); + startup_last_session_radio_->SetChecked(true); EnableCustomHomepagesControls(false); break; case SessionStartupPref::URLS: - startup_custom_radio_->SetIsSelected(true); + startup_custom_radio_->SetChecked(true); EnableCustomHomepagesControls(true); break; } @@ -704,10 +703,10 @@ void GeneralPageView::NotifyPrefChanged(const std::wstring* pref_name) { if (!pref_name || *pref_name == prefs::kHomePageIsNewTabPage) { if (new_tab_page_is_home_page_.GetValue()) { - homepage_use_newtab_radio_->SetIsSelected(true); + homepage_use_newtab_radio_->SetChecked(true); EnableHomepageURLField(false); } else { - homepage_use_url_radio_->SetIsSelected(true); + homepage_use_url_radio_->SetChecked(true); EnableHomepageURLField(true); } } @@ -719,7 +718,7 @@ void GeneralPageView::NotifyPrefChanged(const std::wstring* pref_name) { } if (!pref_name || *pref_name == prefs::kShowHomeButton) { - homepage_show_home_button_checkbox_->SetIsSelected( + homepage_show_home_button_checkbox_->SetChecked( show_home_button_.GetValue()); } } @@ -772,26 +771,23 @@ void GeneralPageView::InitStartupGroup() { startup_homepage_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_DEFAULT_AND_NEWTAB), kStartupRadioGroup); - startup_homepage_radio_->SetListener(this); + startup_homepage_radio_->set_listener(this); startup_last_session_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_LAST_SESSION), kStartupRadioGroup); - startup_last_session_radio_->SetListener(this); + startup_last_session_radio_->set_listener(this); startup_last_session_radio_->SetMultiLine(true); startup_custom_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_PAGES), kStartupRadioGroup); - startup_custom_radio_->SetListener(this); + startup_custom_radio_->set_listener(this); startup_add_custom_page_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_STARTUP_ADD_BUTTON)); - startup_add_custom_page_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_STARTUP_ADD_BUTTON)); startup_remove_custom_page_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_STARTUP_REMOVE_BUTTON)); + this, l10n_util::GetString(IDS_OPTIONS_STARTUP_REMOVE_BUTTON)); startup_remove_custom_page_button_->SetEnabled(false); - startup_remove_custom_page_button_->SetListener(this); startup_use_current_page_button_ = new views::NativeButton( - l10n_util::GetString(IDS_OPTIONS_STARTUP_USE_CURRENT)); - startup_use_current_page_button_->SetListener(this); + this, l10n_util::GetString(IDS_OPTIONS_STARTUP_USE_CURRENT)); startup_custom_pages_table_model_.reset( new CustomHomePagesTableModel(profile())); @@ -866,17 +862,17 @@ void GeneralPageView::InitHomepageGroup() { homepage_use_newtab_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_USE_NEWTAB), kHomePageRadioGroup); - homepage_use_newtab_radio_->SetListener(this); + homepage_use_newtab_radio_->set_listener(this); homepage_use_newtab_radio_->SetMultiLine(true); homepage_use_url_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_USE_URL), kHomePageRadioGroup); - homepage_use_url_radio_->SetListener(this); + homepage_use_url_radio_->set_listener(this); homepage_use_url_textfield_ = new views::TextField; homepage_use_url_textfield_->SetController(this); - homepage_show_home_button_checkbox_ = new views::CheckBox( + homepage_show_home_button_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_SHOW_BUTTON)); - homepage_show_home_button_checkbox_->SetListener(this); + homepage_show_home_button_checkbox_->set_listener(this); homepage_show_home_button_checkbox_->SetMultiLine(true); using views::GridLayout; @@ -923,8 +919,8 @@ void GeneralPageView::InitDefaultSearchGroup() { default_search_engine_combobox_->SetListener(this); default_search_manage_engines_button_ = new views::NativeButton( + this, l10n_util::GetString(IDS_OPTIONS_DEFAULTSEARCH_MANAGE_ENGINES_LINK)); - default_search_manage_engines_button_->SetListener(this); using views::GridLayout; using views::ColumnSet; @@ -956,9 +952,9 @@ void GeneralPageView::InitDefaultBrowserGroup() { default_browser_status_label_->SetHorizontalAlignment( views::Label::ALIGN_LEFT); default_browser_use_as_default_button_ = new views::NativeButton( + this, l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_USEASDEFAULT, l10n_util::GetString(IDS_PRODUCT_NAME))); - default_browser_use_as_default_button_->SetListener(this); using views::GridLayout; using views::ColumnSet; @@ -988,9 +984,9 @@ void GeneralPageView::InitDefaultBrowserGroup() { void GeneralPageView::SaveStartupPref() { SessionStartupPref pref; - if (startup_last_session_radio_->IsSelected()) { + if (startup_last_session_radio_->checked()) { pref.type = SessionStartupPref::LAST; - } else if (startup_custom_radio_->IsSelected()) { + } else if (startup_custom_radio_->checked()) { pref.type = SessionStartupPref::URLS; } diff --git a/chrome/browser/views/options/general_page_view.h b/chrome/browser/views/options/general_page_view.h index eea9cf1..2ec7f4e 100644 --- a/chrome/browser/views/options/general_page_view.h +++ b/chrome/browser/views/options/general_page_view.h @@ -9,13 +9,14 @@ #include "chrome/browser/views/shelf_item_dialog.h" #include "chrome/common/pref_member.h" #include "chrome/views/controls/combo_box.h" -#include "chrome/views/controls/button/native_button.h" +#include "chrome/views/controls/button/button.h" #include "chrome/views/view.h" namespace views { -class CheckBox; +class Checkbox; class GroupboxView; class Label; +class NativeButton; class RadioButton; class TableModel; class TableView; @@ -30,7 +31,7 @@ class SearchEngineListModel; class GeneralPageView : public OptionsPageView, public views::ComboBox::Listener, - public views::NativeButton::Listener, + public views::ButtonListener, public views::TextField::Controller, public ShelfItemDialogDelegate, public views::TableViewObserver { @@ -39,8 +40,8 @@ class GeneralPageView : public OptionsPageView, virtual ~GeneralPageView(); protected: - // views::NativeButton::Listener implementation: - virtual void ButtonPressed(views::NativeButton* sender); + // views::ButtonListener implementation: + virtual void ButtonPressed(views::Button* sender); // views::ComboBox::Listener implementation: virtual void ItemChanged(views::ComboBox* combo_box, @@ -133,7 +134,7 @@ class GeneralPageView : public OptionsPageView, views::RadioButton* homepage_use_newtab_radio_; views::RadioButton* homepage_use_url_radio_; views::TextField* homepage_use_url_textfield_; - views::CheckBox* homepage_show_home_button_checkbox_; + views::Checkbox* homepage_show_home_button_checkbox_; BooleanPrefMember new_tab_page_is_home_page_; StringPrefMember homepage_; BooleanPrefMember show_home_button_; diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index b156523..0ed4f94 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -25,8 +25,6 @@ #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" -#include "chrome/views/controls/button/checkbox.h" -#include "chrome/views/controls/button/native_button.h" #include "chrome/views/controls/button/radio_button.h" #include "chrome/views/controls/combo_box.h" #include "chrome/views/controls/tabbed_pane.h" @@ -495,7 +493,7 @@ LanguagesPageView::~LanguagesPageView() { language_order_table_->SetModel(NULL); } -void LanguagesPageView::ButtonPressed(views::NativeButton* sender) { +void LanguagesPageView::ButtonPressed(views::Button* sender) { if (sender == move_up_button_) { OnMoveUpLanguage(); language_table_edited_ = true; @@ -512,7 +510,7 @@ void LanguagesPageView::ButtonPressed(views::NativeButton* sender) { new AddLanguageWindowView(this, profile()))->Show(); language_table_edited_ = true; } else if (sender == enable_spellchecking_checkbox_) { - if (enable_spellchecking_checkbox_->IsSelected()) + if (enable_spellchecking_checkbox_->checked()) enable_spellcheck_.SetValue(true); else enable_spellcheck_.SetValue(false); @@ -527,21 +525,17 @@ void LanguagesPageView::OnAddLanguage(const std::wstring& new_language) { void LanguagesPageView::InitControlLayout() { // Define the buttons. - add_button_ = new views::NativeButton(l10n_util::GetString( + add_button_ = new views::NativeButton(this, l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_ADD_BUTTON_LABEL)); - add_button_->SetListener(this); - remove_button_ = new views::NativeButton(l10n_util::GetString( + remove_button_ = new views::NativeButton(this, l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_REMOVE_BUTTON_LABEL)); remove_button_->SetEnabled(false); - remove_button_->SetListener(this); - move_up_button_ = new views::NativeButton(l10n_util::GetString( + move_up_button_ = new views::NativeButton(this, l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_MOVEUP_BUTTON_LABEL)); move_up_button_->SetEnabled(false); - move_up_button_->SetListener(this); - move_down_button_ = new views::NativeButton(l10n_util::GetString( + move_down_button_ = new views::NativeButton(this, l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_MOVEDOWN_BUTTON_LABEL)); move_down_button_->SetEnabled(false); - move_down_button_->SetListener(this); languages_contents_ = new views::View; using views::GridLayout; @@ -630,9 +624,9 @@ void LanguagesPageView::InitControlLayout() { l10n_util::GetString(IDS_OPTIONS_CHROME_DICTIONARY_LANGUAGE)); dictionary_language_label_->SetHorizontalAlignment( views::Label::ALIGN_LEFT); - enable_spellchecking_checkbox_ = new views::CheckBox( + enable_spellchecking_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_ENABLE_SPELLCHECK)); - enable_spellchecking_checkbox_->SetListener(this); + enable_spellchecking_checkbox_->set_listener(this); enable_spellchecking_checkbox_->SetMultiLine(true); // Determine Locale Codes. @@ -731,7 +725,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::wstring* pref_name) { spellcheck_language_index_selected_ = -1; } if (!pref_name || *pref_name == prefs::kEnableSpellCheck) { - enable_spellchecking_checkbox_->SetIsSelected( + enable_spellchecking_checkbox_->SetChecked( enable_spellcheck_.GetValue()); } } diff --git a/chrome/browser/views/options/languages_page_view.h b/chrome/browser/views/options/languages_page_view.h index a58cb99..f9f6def 100644 --- a/chrome/browser/views/options/languages_page_view.h +++ b/chrome/browser/views/options/languages_page_view.h @@ -8,13 +8,14 @@ #include "chrome/browser/views/options/options_page_view.h" #include "chrome/common/pref_member.h" #include "chrome/views/controls/combo_box.h" -#include "chrome/views/controls/button/native_button.h" +#include "chrome/views/controls/button/button.h" #include "chrome/views/controls/table/table_view.h" #include "chrome/views/view.h" namespace views { -class CheckBox; +class Checkbox; class Label; +class NativeButton; class TableModel; class TableView; } @@ -27,15 +28,15 @@ class AddLanguageView; // LanguagesPageView class LanguagesPageView : public OptionsPageView, - public views::NativeButton::Listener, + public views::ButtonListener, public views::TableViewObserver, public views::ComboBox::Listener { public: explicit LanguagesPageView(Profile* profile); virtual ~LanguagesPageView(); - // views::NativeButton::Listener implementation: - virtual void ButtonPressed(views::NativeButton* sender); + // views::ButtonListener implementation: + virtual void ButtonPressed(views::Button* sender); // Save Changes made to relevant pref members associated with this tab. // This is public since it is called by FontsLanguageWindowView in its @@ -77,7 +78,7 @@ class LanguagesPageView : public OptionsPageView, views::Label* ui_language_label_; views::ComboBox* change_ui_language_combobox_; views::ComboBox* change_dictionary_language_combobox_; - views::CheckBox* enable_spellchecking_checkbox_; + views::Checkbox* enable_spellchecking_checkbox_; views::Label* dictionary_language_label_; scoped_ptr<LanguageOrderTableModel> language_order_table_model_; |