Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
index b39bdbeb51ff8f676071a11f4cedbc53f1187bac..9c64523f30be9d2a9df27f0d0253debda94f5de7 100644 |
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
@@ -233,8 +233,6 @@ void AutofillDialogViews::NotificationArea::SetNotifications( |
const std::vector<DialogNotification>& notifications) { |
notifications_ = notifications; |
- // Default checkbox to checked. Preserve checkbox state if it already exists. |
- bool checkbox_state = checkbox_ ? checkbox_->checked() : true; |
RemoveAllChildViews(true); |
checkbox_ = NULL; |
@@ -255,7 +253,6 @@ void AutofillDialogViews::NotificationArea::SetNotifications( |
kNotificationPadding, |
kNotificationPadding, |
kNotificationPadding)); |
- checkbox->SetChecked(checkbox_state); |
checkbox->SetText(notification.display_text()); |
checkbox->SetMultiLine(true); |
checkbox->set_alignment(views::TextButtonBase::ALIGN_LEFT); |
@@ -282,10 +279,6 @@ void AutofillDialogViews::NotificationArea::SetNotifications( |
PreferredSizeChanged(); |
} |
-bool AutofillDialogViews::NotificationArea::CheckboxIsChecked() const { |
- return checkbox_ && checkbox_->checked(); |
-} |
- |
std::string AutofillDialogViews::NotificationArea::GetClassName() const { |
return kNotificationAreaClassName; |
} |
@@ -612,6 +605,13 @@ void AutofillDialogViews::UpdateButtonStrip() { |
void AutofillDialogViews::UpdateNotificationArea() { |
DCHECK(notification_area_); |
notification_area_->SetNotifications(controller_->CurrentNotifications()); |
+ |
+ views::Checkbox* checkbox = notification_area_->checkbox(); |
+ if (checkbox) { |
+ checkbox->SetChecked(!controller_->GetPayWithoutWallet()); |
Dan Beam
2013/04/05 02:45:57
an alternative to this would be to use prefs direc
Evan Stade
2013/04/05 23:38:23
make initial checkmark state part of the notificat
Dan Beam
2013/04/06 04:49:50
Done.
|
+ checkbox->set_listener(this); |
Dan Beam
2013/04/05 02:45:57
^ an alternative to this would be to have the noti
Evan Stade
2013/04/05 23:38:23
pass controller_ in and have the NotificationArea
Dan Beam
2013/04/06 04:49:50
Done.
|
+ } |
+ |
ContentsPreferredSizeChanged(); |
} |
@@ -667,10 +667,6 @@ bool AutofillDialogViews::UseBillingForShipping() { |
return use_billing_for_shipping_->checked(); |
} |
-bool AutofillDialogViews::SaveDetailsInWallet() { |
- return notification_area_->CheckboxIsChecked(); |
-} |
- |
bool AutofillDialogViews::SaveDetailsLocally() { |
return save_in_chrome_checkbox_->checked(); |
} |
@@ -805,6 +801,9 @@ void AutofillDialogViews::ButtonPressed(views::Button* sender, |
UpdateDetailsGroupState(*GroupForSection(SECTION_SHIPPING)); |
} else if (sender == cancel_sign_in_) { |
controller_->EndSignInFlow(); |
+ } else if (sender == notification_area_->checkbox()) { |
+ controller_->SetPayWithoutWallet( |
+ !notification_area_->checkbox()->checked()); |
} else { |
// TODO(estade): Should the menu be shown on mouse down? |
DetailsGroup* group = NULL; |