diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 02:51:24 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 02:51:24 +0000 |
commit | c0e0ee4d9be9a9a682210ff1c7853e9f1f8e3770 (patch) | |
tree | e7aaa2c7b2590184574ef482b4fca6a1d03d2702 /chrome | |
parent | c8a6b8e4385e5bb44bf07d17e9c6072d0393b5d9 (diff) | |
download | chromium_src-c0e0ee4d9be9a9a682210ff1c7853e9f1f8e3770.zip chromium_src-c0e0ee4d9be9a9a682210ff1c7853e9f1f8e3770.tar.gz chromium_src-c0e0ee4d9be9a9a682210ff1c7853e9f1f8e3770.tar.bz2 |
Form Autofil Options should be a radio group
The Form Autofil is currently just a checkbox. To fit the chomium design, we prefer radios for single questions because it a bit clearer which choice you choose. As well, we merged import data and clear browsing data into browsing data since the page was getting a bit long.
BUG=13222 (http://crbug.com/13222)
TEST=Tested the options pane, the form autofil worked as expected.
Review URL: http://codereview.chromium.org/119146
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/generated_resources.grd | 32 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.cc | 132 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.h | 16 |
3 files changed, 78 insertions, 102 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index bcdabc2..807e301 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -2996,17 +2996,17 @@ each locale. --> <message name="IDS_OPTIONS_DIALOG_TITLE" desc="The title of the Options dialog box"> <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> Options </message> - <message name="IDS_OPTIONS_GENERAL_TAB_LABEL" desc="The title of the General tab"> - General + <message name="IDS_OPTIONS_GENERAL_TAB_LABEL" desc="The title of the Basics tab"> + Basics </message> - <message name="IDS_OPTIONS_CONTENT_TAB_LABEL" desc="The title of the User Data tab"> - User Data + <message name="IDS_OPTIONS_CONTENT_TAB_LABEL" desc="The title of the Personal Stuff tab"> + Personal Stuff </message> <message name="IDS_OPTIONS_USER_DATA_TAB_LABEL" desc="The title of the User Data tab"> User Data </message> - <message name="IDS_OPTIONS_ADVANCED_TAB_LABEL" desc="The title of the Advanced tab"> - Advanced + <message name="IDS_OPTIONS_ADVANCED_TAB_LABEL" desc="The title of the Under the Hood tab"> + Under the Hood </message> <message name="IDS_OPTIONS_LEARN_MORE_LABEL" desc="In the options dialog, we have links to the support web pages where the user can learn more about a feature."> Learn more @@ -3128,9 +3128,12 @@ each locale. --> <message name="IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME" desc="The title of the form autofill group"> Form autofill: </message> - <message name="IDS_AUTOFILL_SAVEFORMS" desc="The autofill checkbox label"> + <message name="IDS_OPTIONS_AUTOFILL_SAVE" desc="The label of the 'Ask me to save autofill' radio button"> Save text from forms to make them easier to fill out </message> + <message name="IDS_OPTIONS_AUTOFILL_NEVERSAVE" desc="The label of the 'Never save autofill' radio button"> + Never save text from forms + </message> <message name="IDS_THEMES_GROUP_NAME" desc="The title of the themes group"> Themes: @@ -3198,22 +3201,15 @@ each locale. --> Allow all content to load </message> - <message name="IDS_OPTIONS_IMPORT_DATA_GROUP_NAME" desc="The title of the 'Import' group."> - Import: + <message name="IDS_OPTIONS_BROWSING_DATA_GROUP_NAME" desc="The title of the 'Browsing Data' group."> + Browsing Data: </message> - <message name="IDS_OPTIONS_IMPORT_DATA_INFO" desc="Information text about import options."> - You can import your bookmarks and settings from other browsers and user accounts on this computer. + <message name="IDS_OPTIONS_BROWSING_DATA_INFO" desc="Information text about browsing data options."> + You can import your bookmarks and settings from other browsers or clear your browsing data from this computer. </message> <message name="IDS_OPTIONS_IMPORT_DATA_BUTTON" desc="Label for the import data button."> Import data... </message> - - <message name="IDS_OPTIONS_CLEAR_DATA_GROUP_NAME" desc="The title of the 'Clear data' group."> - Clear Data: - </message> - <message name="IDS_OPTIONS_CLEAR_DATA_INFO" desc="Information text about clear data options."> - Clear your browsing data from this computer. Be aware that this may adversely affect the contents of the New Tab Page. - </message> <message name="IDS_OPTIONS_CLEAR_DATA_BUTTON" desc="Label for the Clear data button."> Clear browsing data... </message> diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 3e4f2c3..c1de969 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -36,13 +36,13 @@ ContentPageView::ContentPageView(Profile* profile) passwords_group_(NULL), passwords_asktosave_radio_(NULL), passwords_neversave_radio_(NULL), + form_autofill_asktosave_radio_(NULL), + form_autofill_neversave_radio_(NULL), themes_group_(NULL), themes_reset_button_(NULL), - import_group_(NULL), - import_label_(NULL), + browsing_data_label_(NULL), + browsing_data_group_(NULL), import_button_(NULL), - clear_data_group_(NULL), - clear_data_label_(NULL), clear_data_button_(NULL), OptionsPageView(profile) { } @@ -65,11 +65,9 @@ void ContentPageView::ButtonPressed(views::Button* sender) { profile()->GetPrefs()); } ask_to_save_passwords_.SetValue(enabled); - } else if (sender == passwords_exceptions_button_) { - UserMetricsRecordAction(L"Options_ShowPasswordsExceptions", NULL); - PasswordsExceptionsWindowView::Show(profile()); - } else if (sender == form_autofill_checkbox_) { - bool enabled = form_autofill_checkbox_->checked(); + } else if (sender == form_autofill_asktosave_radio_ || + sender == form_autofill_neversave_radio_) { + bool enabled = form_autofill_asktosave_radio_->checked(); if (enabled) { UserMetricsRecordAction(L"Options_FormAutofill_Enable", profile()->GetPrefs()); @@ -78,6 +76,9 @@ void ContentPageView::ButtonPressed(views::Button* sender) { profile()->GetPrefs()); } form_autofill_.SetValue(enabled); + } else if (sender == passwords_exceptions_button_) { + UserMetricsRecordAction(L"Options_ShowPasswordsExceptions", NULL); + PasswordsExceptionsWindowView::Show(profile()); } else if (sender == themes_reset_button_) { UserMetricsRecordAction(L"Options_ThemesReset", profile()->GetPrefs()); profile()->ClearTheme(); @@ -120,13 +121,8 @@ void ContentPageView::InitControlLayout() { layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); - InitImportGroup(); - layout->AddView(import_group_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, single_column_view_set_id); - InitClearDataGroup(); - layout->AddView(clear_data_group_); + InitBrowsingDataGroup(); + layout->AddView(browsing_data_group_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); @@ -149,7 +145,11 @@ void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { } } if (!pref_name || *pref_name == prefs::kFormAutofillEnabled) { - form_autofill_checkbox_->SetChecked(form_autofill_.GetValue()); + if (form_autofill_.GetValue()) { + form_autofill_asktosave_radio_->SetChecked(true); + } else { + form_autofill_neversave_radio_->SetChecked(true); + } } } @@ -163,8 +163,8 @@ void ContentPageView::Layout() { 0, 0, passwords_group_->GetContentsWidth(), 0); passwords_neversave_radio_->SetBounds( 0, 0, passwords_group_->GetContentsWidth(), 0); - import_label_->SetBounds(0, 0, import_group_->GetContentsWidth(), 0); - clear_data_label_->SetBounds(0, 0, clear_data_group_->GetContentsWidth(), 0); + browsing_data_label_->SetBounds( + 0, 0, browsing_data_group_->GetContentsWidth(), 0); // ... and twice to get the height of multi-line items correct. View::Layout(); } @@ -193,19 +193,11 @@ void ContentPageView::InitPasswordSavingGroup() { GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); - const int single_column_view_set_id = 1; + const int single_column_view_set_id = 0; ColumnSet* column_set = layout->AddColumnSet(single_column_view_set_id); column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); - const int double_column_view_set_id = 0; - column_set = layout->AddColumnSet(double_column_view_set_id); - column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, - GridLayout::USE_PREF, 0, 0); - column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); - column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, - GridLayout::USE_PREF, 0, 0); - layout->StartRow(0, single_column_view_set_id); layout->AddView(passwords_asktosave_radio_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); @@ -221,10 +213,16 @@ void ContentPageView::InitPasswordSavingGroup() { } void ContentPageView::InitFormAutofillGroup() { - form_autofill_checkbox_ = new views::Checkbox( - l10n_util::GetString(IDS_AUTOFILL_SAVEFORMS)); - form_autofill_checkbox_->set_listener(this); - form_autofill_checkbox_->SetMultiLine(true); + form_autofill_asktosave_radio_ = new views::RadioButton( + l10n_util::GetString(IDS_OPTIONS_AUTOFILL_SAVE), + kPasswordSavingRadioGroup); + form_autofill_asktosave_radio_->set_listener(this); + form_autofill_asktosave_radio_->SetMultiLine(true); + form_autofill_neversave_radio_ = new views::RadioButton( + l10n_util::GetString(IDS_OPTIONS_AUTOFILL_NEVERSAVE), + kPasswordSavingRadioGroup); + form_autofill_neversave_radio_->set_listener(this); + form_autofill_neversave_radio_->SetMultiLine(true); using views::GridLayout; using views::ColumnSet; @@ -233,13 +231,16 @@ void ContentPageView::InitFormAutofillGroup() { GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); - const int single_column_view_set_id = 1; + const int single_column_view_set_id = 0; ColumnSet* column_set = layout->AddColumnSet(single_column_view_set_id); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); layout->StartRow(0, single_column_view_set_id); - layout->AddView(form_autofill_checkbox_); + layout->AddView(form_autofill_asktosave_radio_); + layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); + layout->StartRow(0, single_column_view_set_id); + layout->AddView(form_autofill_neversave_radio_); form_autofill_group_ = new OptionsGroupView( contents, l10n_util::GetString(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME), @@ -270,44 +271,15 @@ void ContentPageView::InitThemesGroup() { L"", false); } -void ContentPageView::InitClearDataGroup() { +void ContentPageView::InitBrowsingDataGroup() { clear_data_button_ = new views::NativeButton(this, l10n_util::GetString(IDS_OPTIONS_CLEAR_DATA_BUTTON)); - clear_data_label_ = new views::Label( - l10n_util::GetString(IDS_OPTIONS_CLEAR_DATA_INFO)); - clear_data_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); - clear_data_label_->SetMultiLine(true); - - using views::GridLayout; - using views::ColumnSet; - - views::View* contents = new views::View; - GridLayout* layout = new GridLayout(contents); - contents->SetLayoutManager(layout); - - const int single_column_view_set_id = 1; - ColumnSet* column_set = layout->AddColumnSet(single_column_view_set_id); - column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 1, - GridLayout::USE_PREF, 0, 0); - - layout->StartRow(0, single_column_view_set_id); - layout->AddView(clear_data_label_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - layout->StartRow(0, single_column_view_set_id); - layout->AddView(clear_data_button_); - - clear_data_group_ = new OptionsGroupView( - contents, l10n_util::GetString(IDS_OPTIONS_CLEAR_DATA_GROUP_NAME), - L"", true); -} - -void ContentPageView::InitImportGroup() { import_button_ = new views::NativeButton(this, l10n_util::GetString(IDS_OPTIONS_IMPORT_DATA_BUTTON)); - import_label_ = new views::Label( - l10n_util::GetString(IDS_OPTIONS_IMPORT_DATA_INFO)); - import_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); - import_label_->SetMultiLine(true); + browsing_data_label_ = new views::Label( + l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_INFO)); + browsing_data_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + browsing_data_label_->SetMultiLine(true); using views::GridLayout; using views::ColumnSet; @@ -316,18 +288,30 @@ void ContentPageView::InitImportGroup() { GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); - const int single_column_view_set_id = 1; + // Add the browsing data label component. + const int single_column_view_set_id = 0; ColumnSet* column_set = layout->AddColumnSet(single_column_view_set_id); column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); - layout->StartRow(0, single_column_view_set_id); - layout->AddView(import_label_); + layout->AddView(browsing_data_label_); + + // Add some padding for not making the next component close together. layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - layout->StartRow(0, single_column_view_set_id); + + // Add double column layout for import and clear browsing buttons. + const int double_column_view_set_id = 1; + ColumnSet* double_col_set = layout->AddColumnSet(double_column_view_set_id); + double_col_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, + GridLayout::USE_PREF, 0, 0); + double_col_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); + double_col_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, + GridLayout::USE_PREF, 0, 0); + layout->StartRow(0, double_column_view_set_id); layout->AddView(import_button_); + layout->AddView(clear_data_button_); - import_group_ = new OptionsGroupView( - contents, l10n_util::GetString(IDS_OPTIONS_IMPORT_DATA_GROUP_NAME), + browsing_data_group_ = new OptionsGroupView( + contents, l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME), L"", true); } diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index af5dc4a..e0cabd5 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -43,8 +43,7 @@ class ContentPageView : public OptionsPageView, // Init all the dialog controls. void InitPasswordSavingGroup(); void InitFormAutofillGroup(); - void InitImportGroup(); - void InitClearDataGroup(); + void InitBrowsingDataGroup(); void InitThemesGroup(); // Controls for the Password Saving group @@ -55,7 +54,8 @@ class ContentPageView : public OptionsPageView, // Controls for the Form Autofill group OptionsGroupView* form_autofill_group_; - views::Checkbox* form_autofill_checkbox_; + views::RadioButton* form_autofill_asktosave_radio_; + views::RadioButton* form_autofill_neversave_radio_; // Controls for the Themes group OptionsGroupView* themes_group_; @@ -66,14 +66,10 @@ class ContentPageView : public OptionsPageView, views::RadioButton* popups_show_minimized_radio_; views::RadioButton* popups_block_all_radio_; - // Controls for the Import bookmarks and settings group. - OptionsGroupView* import_group_; - views::Label* import_label_; + // Controls for the browsing data group. + OptionsGroupView* browsing_data_group_; + views::Label* browsing_data_label_; views::NativeButton* import_button_; - - // Controls for Clear browsing data group. - OptionsGroupView* clear_data_group_; - views::Label* clear_data_label_; views::NativeButton* clear_data_button_; BooleanPrefMember ask_to_save_passwords_; |