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

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: about:flags 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(
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 autocomplete_history_manager_->CancelPendingQuery();
544 external_delegate_->OnSuggestionsReturned(
545 query_id, values, labels, icons, unique_ids);
546 }
539 } 547 }
540 548
541 void AutofillManager::FillOrPreviewForm( 549 void AutofillManager::FillOrPreviewForm(
542 AutofillDriver::RendererFormDataAction action, 550 AutofillDriver::RendererFormDataAction action,
543 int query_id, 551 int query_id,
544 const FormData& form, 552 const FormData& form,
545 const FormFieldData& field, 553 const FormFieldData& field,
546 int unique_id) { 554 int unique_id) {
547 if (!IsValidFormData(form) || !IsValidFormFieldData(field)) 555 if (!IsValidFormData(form) || !IsValidFormFieldData(field))
548 return; 556 return;
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 return false; 1250 return false;
1243 1251
1244 // Disregard forms that we wouldn't ever autofill in the first place. 1252 // Disregard forms that we wouldn't ever autofill in the first place.
1245 if (!form.ShouldBeParsed()) 1253 if (!form.ShouldBeParsed())
1246 return false; 1254 return false;
1247 1255
1248 return true; 1256 return true;
1249 } 1257 }
1250 1258
1251 } // namespace autofill 1259 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698