| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // profiles. | 356 // profiles. |
| 357 pref_service_->SetBoolean(prefs::kAutofillUseMacAddressBook, true); | 357 pref_service_->SetBoolean(prefs::kAutofillUseMacAddressBook, true); |
| 358 | 358 |
| 359 // Request permissions. | 359 // Request permissions. |
| 360 GetAddressBook(pref_service_); | 360 GetAddressBook(pref_service_); |
| 361 return true; | 361 return true; |
| 362 } | 362 } |
| 363 | 363 |
| 364 bool PersonalDataManager::ShouldShowAccessAddressBookSuggestion( | 364 bool PersonalDataManager::ShouldShowAccessAddressBookSuggestion( |
| 365 AutofillType type) { | 365 AutofillType type) { |
| 366 if (!enabled_pref_->GetValue()) |
| 367 return false; |
| 368 |
| 366 if (HasPromptedForAccessToAddressBook(pref_service_)) | 369 if (HasPromptedForAccessToAddressBook(pref_service_)) |
| 367 return false; | 370 return false; |
| 368 | 371 |
| 369 switch (type.group()) { | 372 switch (type.group()) { |
| 370 case ADDRESS_BILLING: | 373 case ADDRESS_BILLING: |
| 371 case ADDRESS_HOME: | 374 case ADDRESS_HOME: |
| 372 case EMAIL: | 375 case EMAIL: |
| 373 case NAME: | 376 case NAME: |
| 374 case NAME_BILLING: | 377 case NAME_BILLING: |
| 375 case PHONE_BILLING: | 378 case PHONE_BILLING: |
| 376 case PHONE_HOME: | 379 case PHONE_HOME: |
| 377 return true; | 380 return true; |
| 378 case NO_GROUP: | 381 case NO_GROUP: |
| 379 case COMPANY: | 382 case COMPANY: |
| 380 case CREDIT_CARD: | 383 case CREDIT_CARD: |
| 381 case PASSWORD_FIELD: | 384 case PASSWORD_FIELD: |
| 382 case TRANSACTION: | 385 case TRANSACTION: |
| 383 return false; | 386 return false; |
| 384 } | 387 } |
| 385 | 388 |
| 386 return false; | 389 return false; |
| 387 } | 390 } |
| 388 | 391 |
| 389 void PersonalDataManager::BinaryChanging() { | 392 void PersonalDataManager::BinaryChanging() { |
| 390 g_binary_changed = true; | 393 g_binary_changed = true; |
| 391 } | 394 } |
| 392 | 395 |
| 393 } // namespace autofill | 396 } // namespace autofill |
| OLD | NEW |