OLD | NEW |
---|---|
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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
562 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); | 562 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); |
563 | 563 |
564 // Don't provide credit card suggestions for non-secure pages, but do | 564 // Don't provide credit card suggestions for non-secure pages, but do |
565 // provide them for secure pages with passive mixed content (see impl. of | 565 // provide them for secure pages with passive mixed content (see impl. of |
566 // IsContextSecure). | 566 // IsContextSecure). |
567 if (is_filling_credit_card && !is_context_secure) { | 567 if (is_filling_credit_card && !is_context_secure) { |
568 // Replace the suggestion content with a warning message explaining why | 568 // Replace the suggestion content with a warning message explaining why |
569 // Autofill is disabled for a website. | 569 // Autofill is disabled for a website. |
570 Suggestion warning_suggestion(l10n_util::GetStringUTF16( | 570 Suggestion warning_suggestion(l10n_util::GetStringUTF16( |
571 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); | 571 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); |
572 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; | 572 warning_suggestion.frontend_id = |
573 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE; | |
csashi
2016/11/17 01:41:31
Unrelated to this change, but may be have a sugges
lshang
2016/11/17 07:03:46
I moved this block of code into an method in the f
| |
573 suggestions.assign(1, warning_suggestion); | 574 suggestions.assign(1, warning_suggestion); |
574 | 575 |
575 // On top of the explanation message, first show a "Payment not secure" | 576 // On top of the explanation message, first show a "Payment not secure" |
576 // message. | 577 // message. |
577 if (IsCreditCardAutofillHttpWarningEnabled()) { | 578 if (IsCreditCardAutofillHttpWarningEnabled()) { |
578 Suggestion cc_field_http_warning_suggestion(l10n_util::GetStringUTF16( | 579 Suggestion cc_field_http_warning_suggestion(l10n_util::GetStringUTF16( |
579 IDS_AUTOFILL_CREDIT_CARD_HTTP_WARNING_MESSAGE)); | 580 IDS_AUTOFILL_CREDIT_CARD_HTTP_WARNING_MESSAGE)); |
580 cc_field_http_warning_suggestion.frontend_id = | 581 cc_field_http_warning_suggestion.frontend_id = |
581 POPUP_ITEM_ID_WARNING_MESSAGE; | 582 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE; |
582 suggestions.insert(suggestions.begin(), | 583 suggestions.insert(suggestions.begin(), |
583 cc_field_http_warning_suggestion); | 584 cc_field_http_warning_suggestion); |
584 } | 585 } |
585 } else { | 586 } else { |
586 bool section_is_autofilled = | 587 bool section_is_autofilled = |
587 SectionIsAutofilled(*form_structure, form, | 588 SectionIsAutofilled(*form_structure, form, |
588 autofill_field->section()); | 589 autofill_field->section()); |
589 if (section_is_autofilled) { | 590 if (section_is_autofilled) { |
590 // If the relevant section is auto-filled and the renderer is querying | 591 // If the relevant section is auto-filled and the renderer is querying |
591 // for suggestions, then the user is editing the value of a field. | 592 // for suggestions, then the user is editing the value of a field. |
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2103 if (i > 0) | 2104 if (i > 0) |
2104 fputs("Next oldest form:\n", file); | 2105 fputs("Next oldest form:\n", file); |
2105 } | 2106 } |
2106 fputs("\n", file); | 2107 fputs("\n", file); |
2107 | 2108 |
2108 fclose(file); | 2109 fclose(file); |
2109 } | 2110 } |
2110 #endif // ENABLE_FORM_DEBUG_DUMP | 2111 #endif // ENABLE_FORM_DEBUG_DUMP |
2111 | 2112 |
2112 } // namespace autofill | 2113 } // namespace autofill |
OLD | NEW |