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

Unified Diff: chrome/browser/autofill/autofill_country.h

Issue 6484022: Autofill i18n: Set postal code and state field labels based on the selected country. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: I see you, ICU Created 9 years, 10 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: 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..ad57ccd8f7e75ddbf1c71716a54dd2646221d92f
--- /dev/null
+++ b/chrome/browser/autofill/autofill_country.h
@@ -0,0 +1,43 @@
+// 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"
+
+class AutoFillCountry {
James Hawkins 2011/02/12 20:32:45 Document the class.
Ilya Sherman 2011/02/16 10:27:18 Done.
+ public:
+ // Returns country data corresponding to the two-letter ISO code
+ // |country_code|.
+ static AutoFillCountry CountryForCountryCode(const std::string& country_code);
+
+ // Tries to return the country data most appropriate for the given |locale|.
James Hawkins 2011/02/12 20:32:45 Ambiguities like 'tries' are best removed. The met
Ilya Sherman 2011/02/16 10:27:18 Done.
+ static AutoFillCountry CountryForLocale(const std::string& locale);
+
+ // Fills |countries| with a list of the available countries.
+ static void GetAvailableCountries(std::vector<AutoFillCountry>* countries);
+
+ 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_);
+
+ std::string country_code_;
James Hawkins 2011/02/12 20:32:45 It's up to you, but I think these members could us
Ilya Sherman 2011/02/16 10:27:18 Done.
+ string16 name_;
+ string16 postal_code_label_;
+ string16 state_label_;
+};
+
+#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COUNTRY_H_

Powered by Google App Engine
This is Rietveld 408576698