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

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 667043002: Add a flag to ignore autocomplete="off" for Autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: better comments Created 6 years, 2 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // The first time we show suggestions on this page, log the number of 523 // The first time we show suggestions on this page, log the number of
524 // suggestions shown. 524 // suggestions shown.
525 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) { 525 if (!has_logged_address_suggestions_count_ && !section_is_autofilled) {
526 metric_logger_->LogAddressSuggestionsCount(values.size()); 526 metric_logger_->LogAddressSuggestionsCount(values.size());
527 has_logged_address_suggestions_count_ = true; 527 has_logged_address_suggestions_count_ = true;
528 } 528 }
529 } 529 }
530 } 530 }
531 } 531 }
532 532
533 // Add the results from AutoComplete. They come back asynchronously, so we 533 if (field.should_autocomplete) {
534 // hand off what we generated and they will send the results back to the 534 // Add the results from AutoComplete. They come back asynchronously, so we
535 // renderer. 535 // hand off what we generated and they will send the results back to the
536 autocomplete_history_manager_->OnGetAutocompleteSuggestions( 536 // renderer.
537 query_id, field.name, field.value, field.form_control_type, values, 537 autocomplete_history_manager_->OnGetAutocompleteSuggestions(
groby-ooo-7-16 2014/10/20 22:52:31 Question: OnGetAutocompleteSuggestions also cancel
Evan Stade 2014/10/20 23:01:54 good call, we should probably do autocomplete_hist
538 labels, icons, unique_ids); 538 query_id, field.name, field.value, field.form_control_type, values,
539 labels, icons, unique_ids);
540 } else {
541 // Autocomplete is disabled for this field; only pass back Autofill
542 // suggestions.
543 external_delegate_->OnSuggestionsReturned(
544 query_id, values, labels, icons, unique_ids);
545 }
539 } 546 }
540 547
541 void AutofillManager::FillOrPreviewForm( 548 void AutofillManager::FillOrPreviewForm(
542 AutofillDriver::RendererFormDataAction action, 549 AutofillDriver::RendererFormDataAction action,
543 int query_id, 550 int query_id,
544 const FormData& form, 551 const FormData& form,
545 const FormFieldData& field, 552 const FormFieldData& field,
546 int unique_id) { 553 int unique_id) {
547 if (!IsValidFormData(form) || !IsValidFormFieldData(field)) 554 if (!IsValidFormData(form) || !IsValidFormFieldData(field))
548 return; 555 return;
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 return false; 1249 return false;
1243 1250
1244 // Disregard forms that we wouldn't ever autofill in the first place. 1251 // Disregard forms that we wouldn't ever autofill in the first place.
1245 if (!form.ShouldBeParsed()) 1252 if (!form.ShouldBeParsed())
1246 return false; 1253 return false;
1247 1254
1248 return true; 1255 return true;
1249 } 1256 }
1250 1257
1251 } // namespace autofill 1258 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698