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

Side by Side Diff: chrome/browser/autofill/autofill_country.cc

Issue 6676031: Autofill database migration to clean up bogus profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698