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/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #import <AddressBook/AddressBook.h> | 9 #import <AddressBook/AddressBook.h> |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 // The format string to print |kNumAddressGUIDChars| hexadecimal characters, | 201 // The format string to print |kNumAddressGUIDChars| hexadecimal characters, |
202 // left-padded with 0's. | 202 // left-padded with 0's. |
203 const std::string kAddressGUIDFormat = | 203 const std::string kAddressGUIDFormat = |
204 base::StringPrintf("%%0%" PRIuS "X", kNumAddressGUIDChars); | 204 base::StringPrintf("%%0%" PRIuS "X", kNumAddressGUIDChars); |
205 guid += base::StringPrintf(kAddressGUIDFormat.c_str(), i); | 205 guid += base::StringPrintf(kAddressGUIDFormat.c_str(), i); |
206 DCHECK_EQ(kGUIDLength, guid.size()); | 206 DCHECK_EQ(kGUIDLength, guid.size()); |
207 | 207 |
208 scoped_ptr<AutofillProfile> profile( | 208 scoped_ptr<AutofillProfile> profile( |
209 new AutofillProfile(guid, kAddressBookOrigin)); | 209 new AutofillProfile(guid, kAddressBookOrigin)); |
| 210 profile->set_record_type(AutofillProfile::AUXILIARY_PROFILE); |
210 DCHECK(base::IsValidGUID(profile->guid())); | 211 DCHECK(base::IsValidGUID(profile->guid())); |
211 | 212 |
212 // Fill in name and company information. | 213 // Fill in name and company information. |
213 GetAddressBookNames(me, addressLabelRaw, profile.get()); | 214 GetAddressBookNames(me, addressLabelRaw, profile.get()); |
214 | 215 |
215 // Fill in address information. | 216 // Fill in address information. |
216 GetAddressBookAddress(app_locale, address, profile.get()); | 217 GetAddressBookAddress(app_locale, address, profile.get()); |
217 | 218 |
218 // Fill in email information. | 219 // Fill in email information. |
219 GetAddressBookEmail(me, addressLabelRaw, profile.get()); | 220 GetAddressBookEmail(me, addressLabelRaw, profile.get()); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 408 |
408 int PersonalDataManager::AccessAddressBookPromptCount() { | 409 int PersonalDataManager::AccessAddressBookPromptCount() { |
409 return pref_service_->GetInteger(prefs::kAutofillMacAddressBookShowedCount); | 410 return pref_service_->GetInteger(prefs::kAutofillMacAddressBookShowedCount); |
410 } | 411 } |
411 | 412 |
412 void PersonalDataManager::BinaryChanging() { | 413 void PersonalDataManager::BinaryChanging() { |
413 g_binary_changed = true; | 414 g_binary_changed = true; |
414 } | 415 } |
415 | 416 |
416 } // namespace autofill | 417 } // namespace autofill |
OLD | NEW |