Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7607)

Unified Diff: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h

Issue 2827773003: Restore Payments shipping address info when changing country (Closed)
Patch Set: Fix other platforms compile error Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
index bca043dd61cc7ba0edb6497a10fa08c26bf918f1..13e44b8d33eccf808aff6880439a22aac8e3ff76 100644
--- a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
@@ -78,6 +78,10 @@ class ShippingAddressEditorViewController : public EditorViewController {
// this controller.
autofill::AutofillProfile* profile_to_edit_;
+ // A temporary profile to keep unsaved data in between relayout (e.g., when
+ // the country is changed and fields set may be different).
+ std::unique_ptr<autofill::AutofillProfile> temporary_profile_;
+
// List of fields, reset everytime the current country changes.
std::vector<EditorField> editor_fields_;
@@ -99,6 +103,11 @@ class ShippingAddressEditorViewController : public EditorViewController {
// Called when data changes need to force a view update.
void OnDataChanged();
+ // Saves the current state of the |editor_fields_| in |profile| and ignore
+ // errors if |ignore_errors| is true. Return false on errors, ignored or not.
+ bool SaveFieldsToProfile(autofill::AutofillProfile* profile,
+ bool ignore_errors);
+
// When a combobox model has changed, a view update might be needed, e.g., if
// there is no data in the combobox and it must be converted to a text field.
void OnComboboxModelChanged(views::Combobox* combobox);
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698