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

Side by Side Diff: trunk/src/components/autofill/core/browser/contact_info.cc

Issue 474483002: Revert 289312 "Move StringToUpperASCII and LowerCaseEqualsASCII ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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/contact_info.h" 5 #include "components/autofill/core/browser/contact_info.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 bool ContainsString(const char* const set[], 37 bool ContainsString(const char* const set[],
38 size_t set_size, 38 size_t set_size,
39 const base::string16& element) { 39 const base::string16& element) {
40 if (!base::IsStringASCII(element)) 40 if (!base::IsStringASCII(element))
41 return false; 41 return false;
42 42
43 base::string16 trimmed_element; 43 base::string16 trimmed_element;
44 base::TrimString(element, base::ASCIIToUTF16("."), &trimmed_element); 44 base::TrimString(element, base::ASCIIToUTF16("."), &trimmed_element);
45 45
46 for (size_t i = 0; i < set_size; ++i) { 46 for (size_t i = 0; i < set_size; ++i) {
47 if (base::LowerCaseEqualsASCII(trimmed_element, set[i])) 47 if (LowerCaseEqualsASCII(trimmed_element, set[i]))
48 return true; 48 return true;
49 } 49 }
50 50
51 return false; 51 return false;
52 } 52 }
53 53
54 // Removes common name prefixes from |name_tokens|. 54 // Removes common name prefixes from |name_tokens|.
55 void StripPrefixes(std::vector<base::string16>* name_tokens) { 55 void StripPrefixes(std::vector<base::string16>* name_tokens) {
56 std::vector<base::string16>::iterator iter = name_tokens->begin(); 56 std::vector<base::string16>::iterator iter = name_tokens->begin();
57 while(iter != name_tokens->end()) { 57 while(iter != name_tokens->end()) {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return base::string16(); 348 return base::string16();
349 } 349 }
350 350
351 void CompanyInfo::SetRawInfo(ServerFieldType type, 351 void CompanyInfo::SetRawInfo(ServerFieldType type,
352 const base::string16& value) { 352 const base::string16& value) {
353 DCHECK_EQ(COMPANY_NAME, type); 353 DCHECK_EQ(COMPANY_NAME, type);
354 company_name_ = value; 354 company_name_ = value;
355 } 355 }
356 356
357 } // namespace autofill 357 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698