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

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

Issue 2144653002: [Autofill] Log whether queried credit card form context is secure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_metrics.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 !field.should_autocomplete) { 508 !field.should_autocomplete) {
509 return; 509 return;
510 } 510 }
511 if (is_filling_credit_card) { 511 if (is_filling_credit_card) {
512 suggestions = GetCreditCardSuggestions(field, type); 512 suggestions = GetCreditCardSuggestions(field, type);
513 } else { 513 } else {
514 suggestions = 514 suggestions =
515 GetProfileSuggestions(*form_structure, field, *autofill_field); 515 GetProfileSuggestions(*form_structure, field, *autofill_field);
516 } 516 }
517 if (!suggestions.empty()) { 517 if (!suggestions.empty()) {
518 bool is_context_secure =
519 client_->IsContextSecure(form_structure->source_url());
520 if (is_filling_credit_card)
521 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure);
522
518 // Don't provide credit card suggestions for non-secure pages, but do 523 // Don't provide credit card suggestions for non-secure pages, but do
519 // provide them for secure pages with passive mixed content (see impl. of 524 // provide them for secure pages with passive mixed content (see impl. of
520 // IsContextSecure). 525 // IsContextSecure).
521 if (is_filling_credit_card && 526 if (is_filling_credit_card && !is_context_secure) {
522 !client_->IsContextSecure(form_structure->source_url())) {
523 Suggestion warning_suggestion(l10n_util::GetStringUTF16( 527 Suggestion warning_suggestion(l10n_util::GetStringUTF16(
524 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); 528 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION));
525 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; 529 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE;
526 suggestions.assign(1, warning_suggestion); 530 suggestions.assign(1, warning_suggestion);
527 } else { 531 } else {
528 bool section_is_autofilled = 532 bool section_is_autofilled =
529 SectionIsAutofilled(*form_structure, form, 533 SectionIsAutofilled(*form_structure, form,
530 autofill_field->section()); 534 autofill_field->section());
531 if (section_is_autofilled) { 535 if (section_is_autofilled) {
532 // If the relevant section is auto-filled and the renderer is querying 536 // If the relevant section is auto-filled and the renderer is querying
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 if (i > 0) 2030 if (i > 0)
2027 fputs("Next oldest form:\n", file); 2031 fputs("Next oldest form:\n", file);
2028 } 2032 }
2029 fputs("\n", file); 2033 fputs("\n", file);
2030 2034
2031 fclose(file); 2035 fclose(file);
2032 } 2036 }
2033 #endif // ENABLE_FORM_DEBUG_DUMP 2037 #endif // ENABLE_FORM_DEBUG_DUMP
2034 2038
2035 } // namespace autofill 2039 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698