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

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

Issue 286243002: Mac: Autofill should not immediately request access to address book. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments from isherman. Created 6 years, 7 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
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 4c42479084aa4732c13e1457d04d75277419bf95..54788ff0e603c8fba688cb78dc39d0c18e1b44d4 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -240,6 +240,28 @@ void AutofillManager::ShowAutofillSettings() {
manager_delegate_->ShowAutofillSettings();
}
+#if defined(OS_MACOSX)
+bool AutofillManager::ShouldShowAccessAddressBookSuggestion(
+ const FormData& form,
+ const FormFieldData& field) {
+ if (!personal_data_)
+ return false;
+ FormStructure* form_structure = NULL;
+ AutofillField* autofill_field = NULL;
+ if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field))
+ return false;
+
+ return personal_data_->ShouldShowAccessAddressBookSuggestion(
+ autofill_field->Type());
+}
+
+bool AutofillManager::AccessAddressBook() {
+ if (!personal_data_)
+ return false;
+ return personal_data_->AccessAddressBook();
+}
+#endif // defined(OS_MACOSX)
+
bool AutofillManager::OnFormSubmitted(const FormData& form,
const TimeTicks& timestamp) {
if (!IsValidFormData(form))

Powered by Google App Engine
This is Rietveld 408576698