Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/autofill/autofill_country.h" | 5 #include "chrome/browser/autofill/autofill_country.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 616 const std::string AutofillCountry::GetCountryCode(const string16& country, | 616 const std::string AutofillCountry::GetCountryCode(const string16& country, |
| 617 const std::string& locale) { | 617 const std::string& locale) { |
| 618 return CountryNames::GetInstance()->GetCountryCode(country, locale); | 618 return CountryNames::GetInstance()->GetCountryCode(country, locale); |
| 619 } | 619 } |
| 620 | 620 |
| 621 // static | 621 // static |
| 622 const std::string AutofillCountry::ApplicationLocale() { | 622 const std::string AutofillCountry::ApplicationLocale() { |
| 623 return g_browser_process->GetApplicationLocale(); | 623 return g_browser_process->GetApplicationLocale(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 bool AutofillCountry::IsValidCountry(const string16& value) { | |
| 627 std::string app_locale = ApplicationLocale(); | |
| 628 return !GetCountryCode(value, app_locale).empty(); | |
| 629 } | |
| 630 | |
| 626 AutofillCountry::AutofillCountry(const std::string& country_code, | 631 AutofillCountry::AutofillCountry(const std::string& country_code, |
| 627 const string16& name, | 632 const string16& name, |
| 628 const string16& postal_code_label, | 633 const string16& postal_code_label, |
| 629 const string16& state_label) | 634 const string16& state_label) |
| 630 : country_code_(country_code), | 635 : country_code_(country_code), |
| 631 name_(name), | 636 name_(name), |
| 632 postal_code_label_(postal_code_label), | 637 postal_code_label_(postal_code_label), |
| 633 state_label_(state_label) { | 638 state_label_(state_label) { |
| 634 } | 639 } |
| 640 | |
|
Ilya Sherman
2011/03/16 04:58:57
nit: This line is extraneous.
dhollowa
2011/03/16 16:13:35
Done.
| |
| OLD | NEW |