OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_REGION_DATA_LOADER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_REGION_DATA_LOADER_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "components/autofill/core/browser/region_combobox_model.h" |
| 12 #include "ui/base/models/combobox_model_observer.h" |
| 13 |
| 14 namespace autofill { |
| 15 class RegionDataLoader; |
| 16 } // namespace autofill |
| 17 |
| 18 namespace ui { |
| 19 class ComboboxModel; |
| 20 } // namespace ui |
| 21 |
| 22 @protocol RegionDataLoaderConsumer |
| 23 |
| 24 - (void)regionDataLoaderDidSucceedWithRegions:(NSArray<NSString*>*)regions; |
| 25 |
| 26 @end |
| 27 |
| 28 class RegionDataLoader : public ui::ComboboxModelObserver { |
| 29 public: |
| 30 explicit RegionDataLoader(id<RegionDataLoaderConsumer> consumer); |
| 31 ~RegionDataLoader() override; |
| 32 |
| 33 void LoadRegionData(const std::string& country_code, |
| 34 autofill::RegionDataLoader* autofill_region_data_loader); |
| 35 |
| 36 // ui::ComboboxModelObserver |
| 37 void OnComboboxModelChanged(ui::ComboboxModel* model) override; |
| 38 |
| 39 private: |
| 40 __weak id<RegionDataLoaderConsumer> consumer_; |
| 41 autofill::RegionComboboxModel region_model_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(RegionDataLoader); |
| 44 }; |
| 45 |
| 46 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_REGION_DATA_LOADER_H_ |
OLD | NEW |