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

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

Issue 1234973004: Update SplitString calls in components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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/address.h" 5 #include "components/autofill/core/browser/address.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 case ADDRESS_HOME_ZIP: 124 case ADDRESS_HOME_ZIP:
125 zip_code_ = value; 125 zip_code_ = value;
126 break; 126 break;
127 127
128 case ADDRESS_HOME_SORTING_CODE: 128 case ADDRESS_HOME_SORTING_CODE:
129 sorting_code_ = value; 129 sorting_code_ = value;
130 break; 130 break;
131 131
132 case ADDRESS_HOME_STREET_ADDRESS: 132 case ADDRESS_HOME_STREET_ADDRESS:
133 base::SplitString(value, base::char16('\n'), &street_address_); 133 street_address_ = base::SplitString(
134 value, base::ASCIIToUTF16("\n"),
135 base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
yzshen1 2015/07/22 22:38:23 should this be TRIM_WHITESPACE?
134 break; 136 break;
135 137
136 default: 138 default:
137 NOTREACHED(); 139 NOTREACHED();
138 } 140 }
139 } 141 }
140 142
141 base::string16 Address::GetInfo(const AutofillType& type, 143 base::string16 Address::GetInfo(const AutofillType& type,
142 const std::string& app_locale) const { 144 const std::string& app_locale) const {
143 if (type.html_type() == HTML_TYPE_COUNTRY_CODE) 145 if (type.html_type() == HTML_TYPE_COUNTRY_CODE)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 supported_types->insert(ADDRESS_HOME_COUNTRY); 213 supported_types->insert(ADDRESS_HOME_COUNTRY);
212 } 214 }
213 215
214 void Address::TrimStreetAddress() { 216 void Address::TrimStreetAddress() {
215 while (!street_address_.empty() && street_address_.back().empty()) { 217 while (!street_address_.empty() && street_address_.back().empty()) {
216 street_address_.pop_back(); 218 street_address_.pop_back();
217 } 219 }
218 } 220 }
219 221
220 } // namespace autofill 222 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698