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

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

Issue 2498503002: Http Bad: Add icons to the http warning message (Closed)
Patch Set: Created 4 years, 1 month 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 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 572 warning_suggestion.frontend_id =
573 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE; 573 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE;
574 suggestions.assign(1, warning_suggestion); 574 suggestions.assign(1, warning_suggestion);
575 575
576 // 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"
577 // message. 577 // message.
578 if (IsCreditCardAutofillHttpWarningEnabled()) { 578 if (IsCreditCardAutofillHttpWarningEnabled()) {
579 Suggestion cc_field_http_warning_suggestion(l10n_util::GetStringUTF16( 579 std::string icon_str;
Mathieu 2016/11/16 04:53:09 I think there is enough here to create an anonymou
lshang 2016/11/16 10:33:08 Done.
580 IDS_AUTOFILL_CREDIT_CARD_HTTP_WARNING_MESSAGE)); 580
581 cc_field_http_warning_suggestion.frontend_id = 581 // Show http info icon for http sites.
582 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE; 582 if (form_structure->source_url().is_valid() &&
583 form_structure->source_url().SchemeIs("http")) {
584 icon_str = "http";
585 } else {
586 // Show https_invalid icon for broken https sites.
587 icon_str = "httpsInvalid";
588 }
589
590 Suggestion cc_field_http_warning_suggestion(
591 l10n_util::GetStringUTF8(
592 IDS_AUTOFILL_CREDIT_CARD_HTTP_WARNING_MESSAGE),
593 "", icon_str, POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
583 suggestions.insert(suggestions.begin(), 594 suggestions.insert(suggestions.begin(),
584 cc_field_http_warning_suggestion); 595 cc_field_http_warning_suggestion);
585 } 596 }
586 } else { 597 } else {
587 bool section_is_autofilled = 598 bool section_is_autofilled =
588 SectionIsAutofilled(*form_structure, form, 599 SectionIsAutofilled(*form_structure, form,
589 autofill_field->section()); 600 autofill_field->section());
590 if (section_is_autofilled) { 601 if (section_is_autofilled) {
591 // If the relevant section is auto-filled and the renderer is querying 602 // If the relevant section is auto-filled and the renderer is querying
592 // for suggestions, then the user is editing the value of a field. 603 // for suggestions, then the user is editing the value of a field.
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 if (i > 0) 2115 if (i > 0)
2105 fputs("Next oldest form:\n", file); 2116 fputs("Next oldest form:\n", file);
2106 } 2117 }
2107 fputs("\n", file); 2118 fputs("\n", file);
2108 2119
2109 fclose(file); 2120 fclose(file);
2110 } 2121 }
2111 #endif // ENABLE_FORM_DEBUG_DUMP 2122 #endif // ENABLE_FORM_DEBUG_DUMP
2112 2123
2113 } // namespace autofill 2124 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698