| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 return; | 545 return; |
| 546 } | 546 } |
| 547 if (is_filling_credit_card) { | 547 if (is_filling_credit_card) { |
| 548 suggestions = GetCreditCardSuggestions(field, type); | 548 suggestions = GetCreditCardSuggestions(field, type); |
| 549 } else { | 549 } else { |
| 550 suggestions = | 550 suggestions = |
| 551 GetProfileSuggestions(*form_structure, field, *autofill_field); | 551 GetProfileSuggestions(*form_structure, field, *autofill_field); |
| 552 } | 552 } |
| 553 if (!suggestions.empty()) { | 553 if (!suggestions.empty()) { |
| 554 bool is_context_secure = | 554 bool is_context_secure = |
| 555 client_->IsContextSecure(form_structure->source_url()); | 555 client_->IsContextSecure(form_structure->source_url()) && |
| 556 form_structure->target_url().SchemeIs("https"); |
| 556 if (is_filling_credit_card) | 557 if (is_filling_credit_card) |
| 557 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); | 558 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); |
| 558 | 559 |
| 559 // Don't provide credit card suggestions for non-secure pages, but do | 560 // Don't provide credit card suggestions for non-secure pages, but do |
| 560 // provide them for secure pages with passive mixed content (see impl. of | 561 // provide them for secure pages with passive mixed content (see impl. of |
| 561 // IsContextSecure). | 562 // IsContextSecure). |
| 562 if (is_filling_credit_card && !is_context_secure) { | 563 if (is_filling_credit_card && !is_context_secure) { |
| 563 Suggestion warning_suggestion(l10n_util::GetStringUTF16( | 564 Suggestion warning_suggestion(l10n_util::GetStringUTF16( |
| 564 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); | 565 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); |
| 565 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; | 566 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2081 if (i > 0) | 2082 if (i > 0) |
| 2082 fputs("Next oldest form:\n", file); | 2083 fputs("Next oldest form:\n", file); |
| 2083 } | 2084 } |
| 2084 fputs("\n", file); | 2085 fputs("\n", file); |
| 2085 | 2086 |
| 2086 fclose(file); | 2087 fclose(file); |
| 2087 } | 2088 } |
| 2088 #endif // ENABLE_FORM_DEBUG_DUMP | 2089 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2089 | 2090 |
| 2090 } // namespace autofill | 2091 } // namespace autofill |
| OLD | NEW |