Index: chrome/browser/autofill/autofill_country.h |
diff --git a/chrome/browser/autofill/autofill_country.h b/chrome/browser/autofill/autofill_country.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c88474c07dccbff63956ddf824e512f1d5d6a59b |
--- /dev/null |
+++ b/chrome/browser/autofill/autofill_country.h |
@@ -0,0 +1,57 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ |
+#define CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ |
+#pragma once |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/string16.h" |
+ |
+// Stores data associated with a country. Strings are localized to the app |
+// locale. |
+class AutoFillCountry { |
+ public: |
+ // Returns country data corresponding to the two-letter ISO code |
+ // |country_code|. |
+ explicit AutoFillCountry(const std::string& country_code); |
+ |
+ // Returns the default country code based on the app locale. Returns "US" as a |
+ // fallback if no mapping from the locale is available. |
+ static std::string DefaultCountryCode(); |
+ |
+ // Fills |countries| with a list of the available countries. |
+ static void GetAvailableCountries(std::vector<AutoFillCountry>* countries); |
+ |
+ // Returns the country code corresponding to |country|, which should be a |
+ // localized country name. |
+ static std::string GetCountryCode(const string16& country); |
+ |
+ std::string country_code() const { return country_code_; } |
+ string16 name() const { return name_; } |
+ string16 postal_code_label() const { return postal_code_label_; } |
+ string16 state_label() const { return state_label_; } |
+ |
+ private: |
+ AutoFillCountry(const std::string& country_code, |
+ const string16& name_, |
+ const string16& postal_code_label_, |
+ const string16& state_label_); |
+ |
+ // The two-letter ISO-3166 country code. |
+ std::string country_code_; |
+ |
+ // The country's name, localized to the app locale. |
+ string16 name_; |
+ |
+ // The localized label for the postal code (or zip code) field. |
+ string16 postal_code_label_; |
+ |
+ // The localized label for the state (or province, district, etc.) field. |
+ string16 state_label_; |
+}; |
+ |
+#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_ |