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

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

Issue 2576143002: Tweak payment autofill disabled message in form-not-secure (Closed)
Patch Set: fix comment wrapping Created 4 years 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 client_->IsContextSecure(form_structure->source_url()) && 576 client_->IsContextSecure(form_structure->source_url()) &&
577 (!form_structure->target_url().is_valid() || 577 (!form_structure->target_url().is_valid() ||
578 !form_structure->target_url().SchemeIs("http")); 578 !form_structure->target_url().SchemeIs("http"));
579 if (is_filling_credit_card) 579 if (is_filling_credit_card)
580 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); 580 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure);
581 581
582 // Don't provide credit card suggestions for non-secure pages, but do 582 // Don't provide credit card suggestions for non-secure pages, but do
583 // provide them for secure pages with passive mixed content (see impl. of 583 // provide them for secure pages with passive mixed content (see impl. of
584 // IsContextSecure). 584 // IsContextSecure).
585 if (is_filling_credit_card && !is_context_secure) { 585 if (is_filling_credit_card && !is_context_secure) {
586 bool is_http_warning_enabled = IsCreditCardAutofillHttpWarningEnabled();
586 // Replace the suggestion content with a warning message explaining why 587 // Replace the suggestion content with a warning message explaining why
587 // Autofill is disabled for a website. 588 // Autofill is disabled for a website. The string is different if the
589 // credit card autofill HTTP warning experiment is enabled.
588 Suggestion warning_suggestion(l10n_util::GetStringUTF16( 590 Suggestion warning_suggestion(l10n_util::GetStringUTF16(
589 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); 591 is_http_warning_enabled
592 ? IDS_AUTOFILL_WARNING_PAYMENT_DISABLED
593 : IDS_AUTOFILL_WARNING_INSECURE_CONNECTION));
590 warning_suggestion.frontend_id = 594 warning_suggestion.frontend_id =
591 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE; 595 is_http_warning_enabled
596 ? POPUP_ITEM_ID_PAYMENT_DISABLED_MESSAGE
estark 2016/12/14 23:46:08 I'm not sure if introducing a new PopupItemId is t
Mathieu 2016/12/15 17:52:06 Replied over there. I think we should get rid of w
597 : POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE;
592 suggestions.assign(1, warning_suggestion); 598 suggestions.assign(1, warning_suggestion);
593 599
594 // On top of the explanation message, first show a "Payment not secure" 600 // On top of the explanation message, first show a "Payment not secure"
595 // message. 601 // message.
596 if (IsCreditCardAutofillHttpWarningEnabled()) { 602 if (is_http_warning_enabled) {
597 #if !defined(OS_ANDROID) 603 #if !defined(OS_ANDROID)
598 suggestions.insert(suggestions.begin(), Suggestion()); 604 suggestions.insert(suggestions.begin(), Suggestion());
599 suggestions.front().frontend_id = POPUP_ITEM_ID_SEPARATOR; 605 suggestions.front().frontend_id = POPUP_ITEM_ID_SEPARATOR;
600 #endif 606 #endif
601 suggestions.insert(suggestions.begin(), 607 suggestions.insert(suggestions.begin(),
602 CreateHttpWarningMessageSuggestionItem( 608 CreateHttpWarningMessageSuggestionItem(
603 form_structure->source_url())); 609 form_structure->source_url()));
604 } 610 }
605 } else { 611 } else {
606 bool section_is_autofilled = 612 bool section_is_autofilled =
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 if (i > 0) 2130 if (i > 0)
2125 fputs("Next oldest form:\n", file); 2131 fputs("Next oldest form:\n", file);
2126 } 2132 }
2127 fputs("\n", file); 2133 fputs("\n", file);
2128 2134
2129 fclose(file); 2135 fclose(file);
2130 } 2136 }
2131 #endif // ENABLE_FORM_DEBUG_DUMP 2137 #endif // ENABLE_FORM_DEBUG_DUMP
2132 2138
2133 } // namespace autofill 2139 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698