| 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/autofill_profile.h" | 5 #include "chrome/browser/autofill/autofill_profile.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 for (size_t index = 0; index < arraysize(types); ++index) { | 152 for (size_t index = 0; index < arraysize(types); ++index) { |
| 153 if (GetFieldText(AutoFillType(types[index])) != | 153 if (GetFieldText(AutoFillType(types[index])) != |
| 154 profile.GetFieldText(AutoFillType(types[index]))) | 154 profile.GetFieldText(AutoFillType(types[index]))) |
| 155 return false; | 155 return false; |
| 156 } | 156 } |
| 157 | 157 |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool AutoFillProfile::operator!=(const AutoFillProfile& profile) const { |
| 162 return !operator==(profile); |
| 163 } |
| 164 |
| 161 void AutoFillProfile::set_use_billing_address(bool use) { | 165 void AutoFillProfile::set_use_billing_address(bool use) { |
| 162 if (use_billing_address_ == use) | 166 if (use_billing_address_ == use) |
| 163 return; | 167 return; |
| 164 | 168 |
| 165 Address* billing_address = GetBillingAddress(); | 169 Address* billing_address = GetBillingAddress(); |
| 166 | 170 |
| 167 if (use) { | 171 if (use) { |
| 168 // If we were using the home address as a billing address then the home | 172 // If we were using the home address as a billing address then the home |
| 169 // address information should be cleared out of the billing address object. | 173 // address information should be cleared out of the billing address object. |
| 170 billing_address->Clear(); | 174 billing_address->Clear(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP))) | 218 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP))) |
| 215 << " " | 219 << " " |
| 216 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY))) | 220 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY))) |
| 217 << " " | 221 << " " |
| 218 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( | 222 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( |
| 219 PHONE_HOME_WHOLE_NUMBER))) | 223 PHONE_HOME_WHOLE_NUMBER))) |
| 220 << " " | 224 << " " |
| 221 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( | 225 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( |
| 222 PHONE_FAX_WHOLE_NUMBER))); | 226 PHONE_FAX_WHOLE_NUMBER))); |
| 223 } | 227 } |
| OLD | NEW |