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 // Don't show the access Address Book prompt if the user has built up any |
| 367 // Autofill state. |
| 368 if (!web_profiles_.empty()) |
| 369 return false; |
| 370 |
366 if (!enabled_pref_->GetValue()) | 371 if (!enabled_pref_->GetValue()) |
367 return false; | 372 return false; |
368 | 373 |
369 if (HasPromptedForAccessToAddressBook(pref_service_)) | 374 if (HasPromptedForAccessToAddressBook(pref_service_)) |
370 return false; | 375 return false; |
371 | 376 |
372 switch (type.group()) { | 377 switch (type.group()) { |
373 case ADDRESS_BILLING: | 378 case ADDRESS_BILLING: |
374 case ADDRESS_HOME: | 379 case ADDRESS_HOME: |
375 case EMAIL: | 380 case EMAIL: |
(...skipping 11 matching lines...) Expand all Loading... |
387 } | 392 } |
388 | 393 |
389 return false; | 394 return false; |
390 } | 395 } |
391 | 396 |
392 void PersonalDataManager::BinaryChanging() { | 397 void PersonalDataManager::BinaryChanging() { |
393 g_binary_changed = true; | 398 g_binary_changed = true; |
394 } | 399 } |
395 | 400 |
396 } // namespace autofill | 401 } // namespace autofill |
OLD | NEW |