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

Side by Side Diff: components/autofill/core/browser/phone_number.cc

Issue 1774153002: [Autofill] Add the phone extension type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and adapt heuristic output Created 4 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
« no previous file with comments | « components/autofill/core/browser/phone_field.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/core/browser/phone_number.h" 5 #include "components/autofill/core/browser/phone_number.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/autofill/core/browser/autofill_country.h" 10 #include "components/autofill/core/browser/autofill_country.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 case PHONE_HOME_CITY_CODE: 112 case PHONE_HOME_CITY_CODE:
113 return cached_parsed_phone_.city_code(); 113 return cached_parsed_phone_.city_code();
114 114
115 case PHONE_HOME_COUNTRY_CODE: 115 case PHONE_HOME_COUNTRY_CODE:
116 return cached_parsed_phone_.country_code(); 116 return cached_parsed_phone_.country_code();
117 117
118 case PHONE_HOME_CITY_AND_NUMBER: 118 case PHONE_HOME_CITY_AND_NUMBER:
119 return 119 return
120 cached_parsed_phone_.city_code() + cached_parsed_phone_.number(); 120 cached_parsed_phone_.city_code() + cached_parsed_phone_.number();
121 121
122 case PHONE_HOME_EXTENSION:
123 return base::string16();
124
122 default: 125 default:
123 NOTREACHED(); 126 NOTREACHED();
124 return base::string16(); 127 return base::string16();
125 } 128 }
126 } 129 }
127 130
128 bool PhoneNumber::SetInfo(const AutofillType& type, 131 bool PhoneNumber::SetInfo(const AutofillType& type,
129 const base::string16& value, 132 const base::string16& value,
130 const std::string& app_locale) { 133 const std::string& app_locale) {
131 SetRawInfo(type.GetStorableType(), value); 134 SetRawInfo(type.GetStorableType(), value);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 260
258 return i18n::ConstructPhoneNumber( 261 return i18n::ConstructPhoneNumber(
259 country_, city_, phone_, GetRegion(profile, app_locale), value); 262 country_, city_, phone_, GetRegion(profile, app_locale), value);
260 } 263 }
261 264
262 bool PhoneNumber::PhoneCombineHelper::IsEmpty() const { 265 bool PhoneNumber::PhoneCombineHelper::IsEmpty() const {
263 return phone_.empty() && whole_number_.empty(); 266 return phone_.empty() && whole_number_.empty();
264 } 267 }
265 268
266 } // namespace autofill 269 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/phone_field.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698