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

Unified Diff: chrome/browser/autofill/phone_number_i18n.cc

Issue 6930052: Revert 84320 - Autofill DOMUI Prefs should work with i18n phone numbers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 | « chrome/browser/autofill/phone_number_i18n.h ('k') | chrome/browser/autofill/phone_number_i18n_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/phone_number_i18n.cc
===================================================================
--- chrome/browser/autofill/phone_number_i18n.cc (revision 84345)
+++ chrome/browser/autofill/phone_number_i18n.cc (working copy)
@@ -1,36 +0,0 @@
-// 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.
-
-#include "chrome/browser/autofill/phone_number_i18n.h"
-
-#include "base/logging.h"
-#include "base/utf_string_conversions.h"
-#include "third_party/libphonenumber/cpp/src/phonenumberutil.h"
-
-using namespace i18n::phonenumbers;
-
-namespace autofill_i18n {
-
-bool PhoneNumbersMatch(const string16& number_a,
- const string16& number_b,
- const std::string& country_code) {
- DCHECK(country_code.size() == 0 || country_code.size() == 2);
- std::string safe_country_code(country_code);
- if (safe_country_code.size() == 0)
- safe_country_code = "US";
-
- PhoneNumberUtil *phone_util = PhoneNumberUtil::GetInstance();
- PhoneNumber phone_number_a;
- phone_util->Parse(UTF16ToUTF8(number_a), safe_country_code, &phone_number_a);
- PhoneNumber phone_number_b;
- phone_util->Parse(UTF16ToUTF8(number_b), safe_country_code, &phone_number_b);
-
- PhoneNumberUtil::MatchType match = phone_util->IsNumberMatch(phone_number_a,
- phone_number_b);
- // Allow |NSN_MATCH| for implied country code if one is not set.
- return match == PhoneNumberUtil::NSN_MATCH ||
- match == PhoneNumberUtil::EXACT_MATCH;
-}
-
-} // namespace autofill_i18n
« no previous file with comments | « chrome/browser/autofill/phone_number_i18n.h ('k') | chrome/browser/autofill/phone_number_i18n_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698