| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/autofill/address.h" | 5 #include "chrome/browser/autofill/address.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/autofill/autofill_type.h" | 9 #include "chrome/browser/autofill/autofill_type.h" |
| 10 #include "chrome/browser/autofill/field_types.h" | 10 #include "chrome/browser/autofill/field_types.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 if (field_type == GetStateType()) | 83 if (field_type == GetStateType()) |
| 84 return state(); | 84 return state(); |
| 85 | 85 |
| 86 if (field_type == GetZipCodeType()) | 86 if (field_type == GetZipCodeType()) |
| 87 return zip_code(); | 87 return zip_code(); |
| 88 | 88 |
| 89 if (field_type == GetCountryType()) | 89 if (field_type == GetCountryType()) |
| 90 return country(); | 90 return country(); |
| 91 | 91 |
| 92 return EmptyString16(); | 92 return string16(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void Address::SetInfo(const AutoFillType& type, const string16& value) { | 95 void Address::SetInfo(const AutoFillType& type, const string16& value) { |
| 96 FieldTypeSubGroup subgroup = type.subgroup(); | 96 FieldTypeSubGroup subgroup = type.subgroup(); |
| 97 if (subgroup == AutoFillType::ADDRESS_LINE1) | 97 if (subgroup == AutoFillType::ADDRESS_LINE1) |
| 98 set_line1(value); | 98 set_line1(value); |
| 99 else if (subgroup == AutoFillType::ADDRESS_LINE2) | 99 else if (subgroup == AutoFillType::ADDRESS_LINE2) |
| 100 set_line2(value); | 100 set_line2(value); |
| 101 else if (subgroup == AutoFillType::ADDRESS_APPT_NUM) | 101 else if (subgroup == AutoFillType::ADDRESS_APPT_NUM) |
| 102 set_apt_num(value); | 102 set_apt_num(value); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 bool Address::IsWordInLine(const string16& word, | 256 bool Address::IsWordInLine(const string16& word, |
| 257 const LineTokens& line_tokens) const { | 257 const LineTokens& line_tokens) const { |
| 258 LineTokens::const_iterator iter; | 258 LineTokens::const_iterator iter; |
| 259 for (iter = line_tokens.begin(); iter != line_tokens.end(); ++iter) { | 259 for (iter = line_tokens.begin(); iter != line_tokens.end(); ++iter) { |
| 260 if (word == *iter) | 260 if (word == *iter) |
| 261 return true; | 261 return true; |
| 262 } | 262 } |
| 263 | 263 |
| 264 return false; | 264 return false; |
| 265 } | 265 } |
| OLD | NEW |