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