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

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

Issue 2803443003: [Payments] Added region load failure tolerance and tests to PR editor. (Closed)
Patch Set: Sign bot error fixes 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
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 61d2ee7fce73c81c7baf4e5d0c124a5b9763509b..cae3e188d0c75a78d29ebd7eea973466da8e8f6c 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
@@ -53,11 +53,13 @@ class ShippingAddressEditorViewController : public EditorViewController {
// ValidationDelegate:
bool ValidateTextfield(views::Textfield* textfield) override;
bool ValidateCombobox(views::Combobox* combobox) override;
+ void ComboboxModelChanged(views::Combobox* combobox) override;
private:
bool ValidateValue(const base::string16& value);
EditorField field_;
+
// Raw pointer back to the owner of this class, therefore will not be null.
ShippingAddressEditorViewController* controller_;
@@ -77,11 +79,18 @@ class ShippingAddressEditorViewController : public EditorViewController {
// The list of country codes as ordered in the country combobox model.
std::vector<std::string> country_codes_;
+ // Identifies whether we tried and failed to load region data.
+ bool failed_to_load_region_data_{false};
+
// Updates |editor_fields_| based on the current country.
void UpdateEditorFields();
- // Called by the validation delegate when the country combobox changed.
- void OnCountryChanged(views::Combobox* combobox);
+ // Called when data changes need to force a view update.
+ void OnDataChanged();
+
+ // When a combobox model has changed, a view update might be needed, e.g., if
+ // there is no data in the combox and it must be converted to a text field.
Mathieu 2017/04/05 00:25:14 nit: combobox
MAD 2017/04/07 18:50:40 Done.
+ void OnComboboxModelChanged(views::Combobox* combobox);
DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController);
};

Powered by Google App Engine
This is Rietveld 408576698