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

Unified Diff: components/autofill/browser/state_names.cc

Issue 17392006: In components/autofill, move browser/ to core/browser/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to fix conflicts Created 7 years, 6 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
« no previous file with comments | « components/autofill/browser/state_names.h ('k') | components/autofill/browser/test_autofill_driver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/browser/state_names.cc
diff --git a/components/autofill/browser/state_names.cc b/components/autofill/browser/state_names.cc
deleted file mode 100644
index 339cd1a50793e68221d8ea699e5946387956b80c..0000000000000000000000000000000000000000
--- a/components/autofill/browser/state_names.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright 2013 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.
-
-#include "components/autofill/browser/state_names.h"
-
-#include "base/basictypes.h"
-#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
-
-namespace autofill {
-namespace state_names {
-
-namespace {
-
-// TODO(jhawkins): Add more states/provinces. See http://crbug.com/45039.
-
-struct StateData {
- const char* const name;
- const char abbreviation[3];
-};
-
-StateData kStateData[] = {
- { "alabama", "al" },
- { "alaska", "ak" },
- { "arizona", "az" },
- { "arkansas", "ar" },
- { "california", "ca" },
- { "colorado", "co" },
- { "connecticut", "ct" },
- { "delaware", "de" },
- { "district of columbia", "dc" },
- { "florida", "fl" },
- { "georgia", "ga" },
- { "hawaii", "hi" },
- { "idaho", "id" },
- { "illinois", "il" },
- { "indiana", "in" },
- { "iowa", "ia" },
- { "kansas", "ks" },
- { "kentucky", "ky" },
- { "louisiana", "la" },
- { "maine", "me" },
- { "maryland", "md" },
- { "massachusetts", "ma" },
- { "michigan", "mi" },
- { "minnesota", "mv" },
- { "mississippi", "ms" },
- { "missouri", "mo" },
- { "montana", "mt" },
- { "nebraska", "ne" },
- { "nevada", "nv" },
- { "new hampshire", "nh" },
- { "new jersey", "nj" },
- { "new mexico", "nm" },
- { "new york", "ny" },
- { "north carolina", "nc" },
- { "north dakota", "nd" },
- { "ohio", "oh" },
- { "oklahoma", "ok" },
- { "oregon", "or" },
- { "pennsylvania", "pa" },
- { "puerto rico", "pr" },
- { "rhode island", "ri" },
- { "south carolina", "sc" },
- { "south dakota", "sd" },
- { "tennessee", "tn" },
- { "texas", "tx" },
- { "utah", "ut" },
- { "vermont", "vt" },
- { "virginia", "va" },
- { "washington", "wa" },
- { "west virginia", "wv" },
- { "wisconsin", "wi" },
- { "wyoming", "wy" },
-};
-
-} // namespace
-
-base::string16 GetAbbreviationForName(const base::string16& name) {
- for (size_t i = 0; i < arraysize(kStateData); ++i) {
- const StateData& state = kStateData[i];
- if (LowerCaseEqualsASCII(name, state.name))
- return ASCIIToUTF16(state.abbreviation);
- }
- return base::string16();
-}
-
-base::string16 GetNameForAbbreviation(const base::string16& abbreviation) {
- for (size_t i = 0; i < arraysize(kStateData); ++i) {
- const StateData& state = kStateData[i];
- if (LowerCaseEqualsASCII(abbreviation, state.abbreviation))
- return ASCIIToUTF16(state.name);
- }
- return base::string16();
-}
-
-void GetNameAndAbbreviation(const base::string16& value,
- base::string16* name,
- base::string16* abbreviation) {
- base::string16 full = GetNameForAbbreviation(value);
- base::string16 abbr = value;
- if (full.empty()) {
- abbr = GetAbbreviationForName(value);
- full = value;
- }
-
- if (name)
- name->swap(full);
- if (abbreviation)
- abbreviation->swap(abbr);
-}
-
-} // namespace state_names
-} // namespace autofill
« no previous file with comments | « components/autofill/browser/state_names.h ('k') | components/autofill/browser/test_autofill_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698