Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 512933004: mac: Don't show "Access Address Book" prompt if Autofill is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for form autofillability. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 68d2a361e98cdff996d11e5d7def52bbd4fa7053..80409deda5bf06a1a1177b714b34db0a18f1482c 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -285,13 +285,17 @@ void AutofillManager::ShowAutofillSettings() {
bool AutofillManager::ShouldShowAccessAddressBookSuggestion(
const FormData& form,
const FormFieldData& field) {
- if (!personal_data_)
+ if (!personal_data_ || !field.should_autocomplete)
return false;
+
FormStructure* form_structure = NULL;
AutofillField* autofill_field = NULL;
if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field))
return false;
+ if (!form_structure->IsAutofillable())
+ return false;
+
return personal_data_->ShouldShowAccessAddressBookSuggestion(
autofill_field->Type());
}
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698