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

Side by Side 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: Respond to estade's style suggestion. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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/autofill_manager.h" 5 #include "components/autofill/core/browser/autofill_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 279
280 void AutofillManager::ShowAutofillSettings() { 280 void AutofillManager::ShowAutofillSettings() {
281 client_->ShowAutofillSettings(); 281 client_->ShowAutofillSettings();
282 } 282 }
283 283
284 #if defined(OS_MACOSX) && !defined(OS_IOS) 284 #if defined(OS_MACOSX) && !defined(OS_IOS)
285 bool AutofillManager::ShouldShowAccessAddressBookSuggestion( 285 bool AutofillManager::ShouldShowAccessAddressBookSuggestion(
286 const FormData& form, 286 const FormData& form,
287 const FormFieldData& field) { 287 const FormFieldData& field) {
288 if (!personal_data_) 288 if (!personal_data_ || !field.should_autocomplete)
289 return false; 289 return false;
290
290 FormStructure* form_structure = NULL; 291 FormStructure* form_structure = NULL;
291 AutofillField* autofill_field = NULL; 292 AutofillField* autofill_field = NULL;
292 if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field)) 293 if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field))
293 return false; 294 return false;
294 295
295 return personal_data_->ShouldShowAccessAddressBookSuggestion( 296 return personal_data_->ShouldShowAccessAddressBookSuggestion(
296 autofill_field->Type()); 297 autofill_field->Type());
297 } 298 }
298 299
299 bool AutofillManager::AccessAddressBook() { 300 bool AutofillManager::AccessAddressBook() {
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 return false; 1222 return false;
1222 1223
1223 // Disregard forms that we wouldn't ever autofill in the first place. 1224 // Disregard forms that we wouldn't ever autofill in the first place.
1224 if (!form.ShouldBeParsed()) 1225 if (!form.ShouldBeParsed())
1225 return false; 1226 return false;
1226 1227
1227 return true; 1228 return true;
1228 } 1229 }
1229 1230
1230 } // namespace autofill 1231 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698