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

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

Issue 196793010: Move IsStringASCII/UTF8 to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 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/validation.h" 5 #include "components/autofill/core/browser/validation.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // 175 //
176 // References for current practices: 176 // References for current practices:
177 // http://www.socialsecurity.gov/employer/randomization.html 177 // http://www.socialsecurity.gov/employer/randomization.html
178 // http://www.socialsecurity.gov/employer/randomizationfaqs.html 178 // http://www.socialsecurity.gov/employer/randomizationfaqs.html
179 // 179 //
180 // References for historic practices: 180 // References for historic practices:
181 // http://www.socialsecurity.gov/history/ssn/geocard.html 181 // http://www.socialsecurity.gov/history/ssn/geocard.html
182 // http://www.socialsecurity.gov/employer/stateweb.htm 182 // http://www.socialsecurity.gov/employer/stateweb.htm
183 // http://www.socialsecurity.gov/employer/ssnvhighgroup.htm 183 // http://www.socialsecurity.gov/employer/ssnvhighgroup.htm
184 184
185 if (number_string.length() != 9 || !IsStringASCII(number_string)) 185 if (number_string.length() != 9 || !base::IsStringASCII(number_string))
186 return false; 186 return false;
187 187
188 int area; 188 int area;
189 if (!base::StringToInt(StringPiece16(number_string.begin(), 189 if (!base::StringToInt(StringPiece16(number_string.begin(),
190 number_string.begin() + 3), 190 number_string.begin() + 3),
191 &area)) { 191 &area)) {
192 return false; 192 return false;
193 } 193 }
194 if (area < 1 || 194 if (area < 1 ||
195 area == 666 || 195 area == 666 ||
(...skipping 14 matching lines...) Expand all
210 number_string.begin() + 9), 210 number_string.begin() + 9),
211 &serial) 211 &serial)
212 || serial == 0) { 212 || serial == 0) {
213 return false; 213 return false;
214 } 214 }
215 215
216 return true; 216 return true;
217 } 217 }
218 218
219 } // namespace autofill 219 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/address.cc ('k') | components/storage_monitor/portable_device_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698