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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 } | 549 } |
550 if (is_filling_credit_card) { | 550 if (is_filling_credit_card) { |
551 suggestions = GetCreditCardSuggestions(field, type); | 551 suggestions = GetCreditCardSuggestions(field, type); |
552 } else { | 552 } else { |
553 suggestions = | 553 suggestions = |
554 GetProfileSuggestions(*form_structure, field, *autofill_field); | 554 GetProfileSuggestions(*form_structure, field, *autofill_field); |
555 } | 555 } |
556 if (!suggestions.empty()) { | 556 if (!suggestions.empty()) { |
557 bool is_context_secure = | 557 bool is_context_secure = |
558 client_->IsContextSecure(form_structure->source_url()) && | 558 client_->IsContextSecure(form_structure->source_url()) && |
559 form_structure->target_url().SchemeIs("https"); | 559 (!form_structure->target_url().is_valid() || |
| 560 !form_structure->target_url().SchemeIs("http")); |
560 if (is_filling_credit_card) | 561 if (is_filling_credit_card) |
561 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); | 562 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); |
562 | 563 |
563 // 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 |
564 // 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 |
565 // IsContextSecure). | 566 // IsContextSecure). |
566 if (is_filling_credit_card && !is_context_secure) { | 567 if (is_filling_credit_card && !is_context_secure) { |
567 Suggestion warning_suggestion(l10n_util::GetStringUTF16( | 568 Suggestion warning_suggestion(l10n_util::GetStringUTF16( |
568 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); | 569 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); |
569 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; | 570 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 if (i > 0) | 2088 if (i > 0) |
2088 fputs("Next oldest form:\n", file); | 2089 fputs("Next oldest form:\n", file); |
2089 } | 2090 } |
2090 fputs("\n", file); | 2091 fputs("\n", file); |
2091 | 2092 |
2092 fclose(file); | 2093 fclose(file); |
2093 } | 2094 } |
2094 #endif // ENABLE_FORM_DEBUG_DUMP | 2095 #endif // ENABLE_FORM_DEBUG_DUMP |
2095 | 2096 |
2096 } // namespace autofill | 2097 } // namespace autofill |
OLD | NEW |