| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/personal_data_manager.h" | 5 #include "chrome/browser/autofill/personal_data_manager.h" |
| 6 | 6 |
| 7 #import <AddressBook/AddressBook.h> | 7 #import <AddressBook/AddressBook.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } else if ([addressLabelRaw isEqualToString:kABAddressWorkLabel] && | 207 } else if ([addressLabelRaw isEqualToString:kABAddressWorkLabel] && |
| 208 [phoneLabelRaw isEqualToString:kABPhoneWorkLabel]) { | 208 [phoneLabelRaw isEqualToString:kABPhoneWorkLabel]) { |
| 209 string16 workPhone = base::SysNSStringToUTF16( | 209 string16 workPhone = base::SysNSStringToUTF16( |
| 210 [phoneNumbers valueAtIndex:reverseK]); | 210 [phoneNumbers valueAtIndex:reverseK]); |
| 211 profile->SetInfo(PHONE_HOME_WHOLE_NUMBER, workPhone); | 211 profile->SetInfo(PHONE_HOME_WHOLE_NUMBER, workPhone); |
| 212 } else if ([addressLabelRaw isEqualToString:kABAddressWorkLabel] && | 212 } else if ([addressLabelRaw isEqualToString:kABAddressWorkLabel] && |
| 213 [phoneLabelRaw isEqualToString:kABPhoneWorkFAXLabel]) { | 213 [phoneLabelRaw isEqualToString:kABPhoneWorkFAXLabel]) { |
| 214 string16 workFax = base::SysNSStringToUTF16( | 214 string16 workFax = base::SysNSStringToUTF16( |
| 215 [phoneNumbers valueAtIndex:reverseK]); | 215 [phoneNumbers valueAtIndex:reverseK]); |
| 216 profile->SetInfo(PHONE_FAX_WHOLE_NUMBER, workFax); | 216 profile->SetInfo(PHONE_FAX_WHOLE_NUMBER, workFax); |
| 217 } else if ([phoneLabelRaw isEqualToString:kABPhoneMobileLabel] || |
| 218 [phoneLabelRaw isEqualToString:kABPhoneMainLabel]) { |
| 219 string16 phone = base::SysNSStringToUTF16( |
| 220 [phoneNumbers valueAtIndex:reverseK]); |
| 221 profile->SetInfo(PHONE_HOME_WHOLE_NUMBER, phone); |
| 217 } | 222 } |
| 218 } | 223 } |
| 219 } | 224 } |
| 220 | 225 |
| 221 } // namespace | 226 } // namespace |
| 222 | 227 |
| 223 // Populate |auxiliary_profiles_| with the Address Book data. | 228 // Populate |auxiliary_profiles_| with the Address Book data. |
| 224 void PersonalDataManager::LoadAuxiliaryProfiles() const { | 229 void PersonalDataManager::LoadAuxiliaryProfiles() const { |
| 225 AuxiliaryProfilesImpl impl(&auxiliary_profiles_); | 230 AuxiliaryProfilesImpl impl(&auxiliary_profiles_); |
| 226 impl.GetAddressBookMeCard(); | 231 impl.GetAddressBookMeCard(); |
| 227 } | 232 } |
| OLD | NEW |