| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 CountryComboboxModel(); | 25 CountryComboboxModel(); |
| 26 virtual ~CountryComboboxModel(); | 26 virtual ~CountryComboboxModel(); |
| 27 | 27 |
| 28 // |filter| is passed each known country's country code. If |filter| returns | 28 // |filter| is passed each known country's country code. If |filter| returns |
| 29 // true, an item for that country is added to the model (else it's omitted). | 29 // true, an item for that country is added to the model (else it's omitted). |
| 30 // |manager| determines the default choice. | 30 // |manager| determines the default choice. |
| 31 void SetCountries(const PersonalDataManager& manager, | 31 void SetCountries(const PersonalDataManager& manager, |
| 32 const base::Callback<bool(const std::string&)>& filter); | 32 const base::Callback<bool(const std::string&)>& filter); |
| 33 | 33 |
| 34 // ui::ComboboxModel implementation: | 34 // ui::ComboboxModel implementation: |
| 35 virtual int GetItemCount() const OVERRIDE; | 35 virtual int GetItemCount() const override; |
| 36 virtual base::string16 GetItemAt(int index) OVERRIDE; | 36 virtual base::string16 GetItemAt(int index) override; |
| 37 virtual bool IsItemSeparatorAt(int index) OVERRIDE; | 37 virtual bool IsItemSeparatorAt(int index) override; |
| 38 | 38 |
| 39 const std::vector<AutofillCountry*>& countries() const { | 39 const std::vector<AutofillCountry*>& countries() const { |
| 40 return countries_.get(); | 40 return countries_.get(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Returns the default country code for this model. | 43 // Returns the default country code for this model. |
| 44 std::string GetDefaultCountryCode() const; | 44 std::string GetDefaultCountryCode() const; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // The countries to show in the model, including NULL for entries that are | 47 // The countries to show in the model, including NULL for entries that are |
| 48 // not countries (the separator entry). | 48 // not countries (the separator entry). |
| 49 ScopedVector<AutofillCountry> countries_; | 49 ScopedVector<AutofillCountry> countries_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(CountryComboboxModel); | 51 DISALLOW_COPY_AND_ASSIGN(CountryComboboxModel); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace autofill | 54 } // namespace autofill |
| 55 | 55 |
| 56 #endif // CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_ | 56 #endif // CHROME_BROWSER_UI_AUTOFILL_COUNTRY_COMBOBOX_MODEL_H_ |
| OLD | NEW |