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

Unified Diff: components/autofill/core/browser/region_combobox_model.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: components/autofill/core/browser/region_combobox_model.h
diff --git a/components/autofill/core/browser/region_combobox_model.h b/components/autofill/core/browser/region_combobox_model.h
index 7d925711724a28698ab49855216d136a784b3464..77b85a274f1cfcc9053545cb5d3b89ef54e194c6 100644
--- a/components/autofill/core/browser/region_combobox_model.h
+++ b/components/autofill/core/browser/region_combobox_model.h
@@ -36,6 +36,9 @@ class RegionComboboxModel : public ui::ComboboxModel {
const std::string& country_code);
~RegionComboboxModel() override;
+ bool pending_region_data_load() const { return pending_region_data_load_; }
+ bool failed_to_load_data() const { return failed_to_load_data_; }
+
// ui::ComboboxModel implementation:
int GetItemCount() const override;
base::string16 GetItemAt(int index) override;
@@ -43,13 +46,20 @@ class RegionComboboxModel : public ui::ComboboxModel {
void AddObserver(ui::ComboboxModelObserver* observer) override;
void RemoveObserver(ui::ComboboxModelObserver* observer) override;
+ // To allow testing failure states.
+ void SetFailureModeForTests(bool failed_to_load_data);
+
+ private:
// Callback for ::i18n::addressinput::PreloadSupplier::LoadRules
void RegionDataLoaded(bool success, const std::string&, int rule_count);
- private:
// Whether the region data load failed or not.
bool failed_to_load_data_{false};
+ // Set to true during region data load, and false otherwise. Whether the load
+ // succeeded or not doesn't affect this value.
+ bool pending_region_data_load_{false};
+
// The application locale.
const std::string app_locale_;

Powered by Google App Engine
This is Rietveld 408576698