diff options
author | dantasse@chromium.org <dantasse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 23:03:14 +0000 |
---|---|---|
committer | dantasse@chromium.org <dantasse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 23:03:14 +0000 |
commit | 5aa74cb012c23ee3590016ea9bfe724cdb4b1be1 (patch) | |
tree | 30ecad95d3b2298454e49db439cfdbbcc02becd4 /chrome | |
parent | 9e608be9416b7efe8e5d29375a09a02a84a304d1 (diff) | |
download | chromium_src-5aa74cb012c23ee3590016ea9bfe724cdb4b1be1.zip chromium_src-5aa74cb012c23ee3590016ea9bfe724cdb4b1be1.tar.gz chromium_src-5aa74cb012c23ee3590016ea9bfe724cdb4b1be1.tar.bz2 |
Put Autofill after Themes on Windows and Linux too, to match Mac, in the Customize Sync dialog. (this is because we're shipping Themes first)
BUG=41833
TEST=visual inspection: bring up the Customize Sync dialog. The Themes checkbox should be before the Autofill one.
Review URL: http://codereview.chromium.org/1715002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
3 files changed, 44 insertions, 43 deletions
diff --git a/chrome/browser/gtk/options/customize_sync_window_gtk.cc b/chrome/browser/gtk/options/customize_sync_window_gtk.cc index 04a698f..65f3ff5 100644 --- a/chrome/browser/gtk/options/customize_sync_window_gtk.cc +++ b/chrome/browser/gtk/options/customize_sync_window_gtk.cc @@ -59,10 +59,10 @@ class CustomizeSyncWindowGtk { Profile* profile_; GtkWidget* description_label_; - GtkWidget* autofill_check_box_; GtkWidget* bookmarks_check_box_; GtkWidget* preferences_check_box_; GtkWidget* themes_check_box_; + GtkWidget* autofill_check_box_; // Helper object to manage accessibility metadata. scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; @@ -79,10 +79,10 @@ static CustomizeSyncWindowGtk* customize_sync_window = NULL; CustomizeSyncWindowGtk::CustomizeSyncWindowGtk(Profile* profile) : profile_(profile), description_label_(NULL), - autofill_check_box_(NULL), bookmarks_check_box_(NULL), preferences_check_box_(NULL), - themes_check_box_(NULL) { + themes_check_box_(NULL), + autofill_check_box_(NULL) { syncable::ModelTypeSet registered_types; profile_->GetProfileSyncService()->GetRegisteredDataTypes(®istered_types); syncable::ModelTypeSet preferred_types; @@ -130,18 +130,18 @@ CustomizeSyncWindowGtk::CustomizeSyncWindowGtk(Profile* profile) prefs_checked); } - if (registered_types.count(syncable::AUTOFILL)) { - bool autofill_checked = preferred_types.count(syncable::AUTOFILL) != 0; - autofill_check_box_ = AddCheckbox(vbox, IDS_SYNC_DATATYPE_AUTOFILL, - autofill_checked); - } - if (registered_types.count(syncable::THEMES)) { bool themes_checked = preferred_types.count(syncable::THEMES) != 0; themes_check_box_ = AddCheckbox(vbox, IDS_SYNC_DATATYPE_THEMES, themes_checked); } + if (registered_types.count(syncable::AUTOFILL)) { + bool autofill_checked = preferred_types.count(syncable::AUTOFILL) != 0; + autofill_check_box_ = AddCheckbox(vbox, IDS_SYNC_DATATYPE_AUTOFILL, + autofill_checked); + } + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), vbox, FALSE, FALSE, 0); gtk_widget_realize(dialog_); @@ -171,10 +171,10 @@ bool CustomizeSyncWindowGtk::ClickOk() { (preferences_check_box_ && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( preferences_check_box_))) || - (autofill_check_box_ && - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(autofill_check_box_))) || (themes_check_box_ && - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(themes_check_box_)))) { + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(themes_check_box_))) || + (autofill_check_box_ && + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(autofill_check_box_)))) { Accept(); gtk_widget_destroy(GTK_WIDGET(dialog_)); return true; @@ -225,13 +225,6 @@ bool CustomizeSyncWindowGtk::Accept() { preferred_types.insert(syncable::PREFERENCES); } } - if (autofill_check_box_) { - bool autofill_enabled = gtk_toggle_button_get_active( - GTK_TOGGLE_BUTTON(autofill_check_box_)); - if (autofill_enabled) { - preferred_types.insert(syncable::AUTOFILL); - } - } if (themes_check_box_) { bool themes_enabled = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(themes_check_box_)); @@ -239,6 +232,13 @@ bool CustomizeSyncWindowGtk::Accept() { preferred_types.insert(syncable::THEMES); } } + if (autofill_check_box_) { + bool autofill_enabled = gtk_toggle_button_get_active( + GTK_TOGGLE_BUTTON(autofill_check_box_)); + if (autofill_enabled) { + preferred_types.insert(syncable::AUTOFILL); + } + } profile_->GetProfileSyncService()->ChangePreferredDataTypes(preferred_types); return true; @@ -269,10 +269,10 @@ void CustomizeSyncWindowGtk::OnCheckboxClicked(GtkWidget* widget) { (preferences_check_box_ && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( preferences_check_box_))) || - (autofill_check_box_ && - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(autofill_check_box_))) || (themes_check_box_ && - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(themes_check_box_))); + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(themes_check_box_))) || + (autofill_check_box_ && + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(autofill_check_box_))); if (any_datatypes_selected) { gtk_dialog_set_response_sensitive( GTK_DIALOG(customize_sync_window->dialog_), GTK_RESPONSE_OK, TRUE); diff --git a/chrome/browser/views/options/customize_sync_window_view.cc b/chrome/browser/views/options/customize_sync_window_view.cc index 602fec1..a4e3b5c 100755 --- a/chrome/browser/views/options/customize_sync_window_view.cc +++ b/chrome/browser/views/options/customize_sync_window_view.cc @@ -29,8 +29,8 @@ CustomizeSyncWindowView::CustomizeSyncWindowView(Profile* profile) description_label_(NULL), bookmarks_check_box_(NULL), preferences_check_box_(NULL), - autofill_check_box_(NULL), - themes_check_box_(NULL) { + themes_check_box_(NULL), + autofill_check_box_(NULL) { DCHECK(profile); Init(); } @@ -102,6 +102,16 @@ void CustomizeSyncWindowView::Layout() { last_view = preferences_check_box_; } + if (themes_check_box_) { + sz = themes_check_box_->GetPreferredSize(); + themes_check_box_->SetBounds(2 * kPanelHorizMargin, + last_view->y() + + last_view->height() + + kRelatedControlVerticalSpacing, + sz.width(), sz.height()); + last_view = themes_check_box_; + } + if (autofill_check_box_) { sz = autofill_check_box_->GetPreferredSize(); autofill_check_box_->SetBounds(2 * kPanelHorizMargin, @@ -112,15 +122,6 @@ void CustomizeSyncWindowView::Layout() { last_view = autofill_check_box_; } - if (themes_check_box_) { - sz = themes_check_box_->GetPreferredSize(); - themes_check_box_->SetBounds(2 * kPanelHorizMargin, - last_view->y() + - last_view->height() + - kRelatedControlVerticalSpacing, - sz.width(), sz.height()); - last_view = themes_check_box_; - } } gfx::Size CustomizeSyncWindowView::GetPreferredSize() { @@ -147,12 +148,12 @@ bool CustomizeSyncWindowView::Accept() { if (preferences_check_box_ && preferences_check_box_->checked()) { desired_types.insert(syncable::PREFERENCES); } - if (autofill_check_box_ && autofill_check_box_->checked()) { - desired_types.insert(syncable::AUTOFILL); - } if (themes_check_box_ && themes_check_box_->checked()) { desired_types.insert(syncable::THEMES); } + if (autofill_check_box_ && autofill_check_box_->checked()) { + desired_types.insert(syncable::AUTOFILL); + } // You shouldn't be able to accept if you've selected 0 datatypes. DCHECK(!desired_types.empty()); @@ -248,15 +249,15 @@ void CustomizeSyncWindowView::Init() { l10n_util::GetString(IDS_SYNC_DATATYPE_PREFERENCES), prefs_checked); } - if (registered_types.count(syncable::AUTOFILL)) { - bool autofill_checked = preferred_types.count(syncable::AUTOFILL) != 0; - autofill_check_box_ = AddCheckbox( - l10n_util::GetString(IDS_SYNC_DATATYPE_AUTOFILL), autofill_checked); - } - if (registered_types.count(syncable::THEMES)) { bool themes_checked = preferred_types.count(syncable::THEMES) != 0; themes_check_box_ = AddCheckbox( l10n_util::GetString(IDS_SYNC_DATATYPE_THEMES), themes_checked); } + + if (registered_types.count(syncable::AUTOFILL)) { + bool autofill_checked = preferred_types.count(syncable::AUTOFILL) != 0; + autofill_check_box_ = AddCheckbox( + l10n_util::GetString(IDS_SYNC_DATATYPE_AUTOFILL), autofill_checked); + } } diff --git a/chrome/browser/views/options/customize_sync_window_view.h b/chrome/browser/views/options/customize_sync_window_view.h index ef51c14..0179427 100755 --- a/chrome/browser/views/options/customize_sync_window_view.h +++ b/chrome/browser/views/options/customize_sync_window_view.h @@ -74,8 +74,8 @@ class CustomizeSyncWindowView : public views::View, views::Label* description_label_; views::Checkbox* bookmarks_check_box_; views::Checkbox* preferences_check_box_; - views::Checkbox* autofill_check_box_; views::Checkbox* themes_check_box_; + views::Checkbox* autofill_check_box_; Profile* profile_; |