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

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: Require forms be autofillable. 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_)
289 return false; 289 return false;
290 FormStructure* form_structure = NULL; 290 FormStructure* form_structure = NULL;
291 AutofillField* autofill_field = NULL; 291 AutofillField* autofill_field = NULL;
292 if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field)) 292 if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field))
293 return false; 293 return false;
294 294
295 if (!form_structure->IsAutofillable())
Evan Stade 2014/08/28 00:33:16 why are we even getting to this point if the form
erikchen 2014/08/28 00:39:37 I don't know. See the first exchange between isher
296 return false;
Ilya Sherman 2014/08/28 00:34:19 Could you add test coverage for this change as wel
erikchen 2014/08/28 17:01:17 Done.
297
295 return personal_data_->ShouldShowAccessAddressBookSuggestion( 298 return personal_data_->ShouldShowAccessAddressBookSuggestion(
296 autofill_field->Type()); 299 autofill_field->Type());
297 } 300 }
298 301
299 bool AutofillManager::AccessAddressBook() { 302 bool AutofillManager::AccessAddressBook() {
300 if (!personal_data_) 303 if (!personal_data_)
301 return false; 304 return false;
302 return personal_data_->AccessAddressBook(); 305 return personal_data_->AccessAddressBook();
303 } 306 }
304 #endif // defined(OS_MACOSX) && !defined(OS_IOS) 307 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 // The first time we show suggestions on this page, log the number of 508 // The first time we show suggestions on this page, log the number of
506 // suggestions shown. 509 // suggestions shown.
507 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) { 510 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) {
508 metric_logger_->LogAddressSuggestionsCount(values.size()); 511 metric_logger_->LogAddressSuggestionsCount(values.size());
509 has_logged_address_suggestions_count_ = true; 512 has_logged_address_suggestions_count_ = true;
510 } 513 }
511 } 514 }
512 } 515 }
513 } 516 }
514 517
515 // Add the results from AutoComplete. They come back asynchronously, so we 518 // Add the results from AutoComplete. They come back asynchronously, so we
Evan Stade 2014/08/28 00:33:16 it doesn't seem like we should be doing this eithe
erikchen 2014/08/28 17:01:17 I'm probably not the best person to answer this. i
Evan Stade 2014/08/28 17:18:58 ignore this question; <form autocomplete="off"> is
516 // hand off what we generated and they will send the results back to the 519 // hand off what we generated and they will send the results back to the
517 // renderer. 520 // renderer.
518 autocomplete_history_manager_->OnGetAutocompleteSuggestions( 521 autocomplete_history_manager_->OnGetAutocompleteSuggestions(
519 query_id, field.name, field.value, field.form_control_type, values, 522 query_id, field.name, field.value, field.form_control_type, values,
520 labels, icons, unique_ids); 523 labels, icons, unique_ids);
521 } 524 }
522 525
523 void AutofillManager::FillOrPreviewForm( 526 void AutofillManager::FillOrPreviewForm(
524 AutofillDriver::RendererFormDataAction action, 527 AutofillDriver::RendererFormDataAction action,
525 int query_id, 528 int query_id,
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 return false; 1224 return false;
1222 1225
1223 // Disregard forms that we wouldn't ever autofill in the first place. 1226 // Disregard forms that we wouldn't ever autofill in the first place.
1224 if (!form.ShouldBeParsed()) 1227 if (!form.ShouldBeParsed())
1225 return false; 1228 return false;
1226 1229
1227 return true; 1230 return true;
1228 } 1231 }
1229 1232
1230 } // namespace autofill 1233 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/personal_data_manager_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698