| OLD | NEW |
| 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 27 matching lines...) Expand all Loading... |
| 38 bool ContainsString(const char* const set[], | 38 bool ContainsString(const char* const set[], |
| 39 size_t set_size, | 39 size_t set_size, |
| 40 const base::string16& element) { | 40 const base::string16& element) { |
| 41 if (!base::IsStringASCII(element)) | 41 if (!base::IsStringASCII(element)) |
| 42 return false; | 42 return false; |
| 43 | 43 |
| 44 base::string16 trimmed_element; | 44 base::string16 trimmed_element; |
| 45 base::TrimString(element, base::ASCIIToUTF16("."), &trimmed_element); | 45 base::TrimString(element, base::ASCIIToUTF16("."), &trimmed_element); |
| 46 | 46 |
| 47 for (size_t i = 0; i < set_size; ++i) { | 47 for (size_t i = 0; i < set_size; ++i) { |
| 48 if (LowerCaseEqualsASCII(trimmed_element, set[i])) | 48 if (base::LowerCaseEqualsASCII(trimmed_element, set[i])) |
| 49 return true; | 49 return true; |
| 50 } | 50 } |
| 51 | 51 |
| 52 return false; | 52 return false; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Removes common name prefixes from |name_tokens|. | 55 // Removes common name prefixes from |name_tokens|. |
| 56 void StripPrefixes(std::vector<base::string16>* name_tokens) { | 56 void StripPrefixes(std::vector<base::string16>* name_tokens) { |
| 57 std::vector<base::string16>::iterator iter = name_tokens->begin(); | 57 std::vector<base::string16>::iterator iter = name_tokens->begin(); |
| 58 while(iter != name_tokens->end()) { | 58 while(iter != name_tokens->end()) { |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 return base::string16(); | 347 return base::string16(); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void CompanyInfo::SetRawInfo(ServerFieldType type, | 350 void CompanyInfo::SetRawInfo(ServerFieldType type, |
| 351 const base::string16& value) { | 351 const base::string16& value) { |
| 352 DCHECK_EQ(COMPANY_NAME, type); | 352 DCHECK_EQ(COMPANY_NAME, type); |
| 353 company_name_ = value; | 353 company_name_ = value; |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace autofill | 356 } // namespace autofill |
| OLD | NEW |