| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 !field.should_autocomplete) { | 434 !field.should_autocomplete) { |
| 435 return; | 435 return; |
| 436 } | 436 } |
| 437 if (is_filling_credit_card) { | 437 if (is_filling_credit_card) { |
| 438 suggestions = GetCreditCardSuggestions(field, type); | 438 suggestions = GetCreditCardSuggestions(field, type); |
| 439 } else { | 439 } else { |
| 440 suggestions = | 440 suggestions = |
| 441 GetProfileSuggestions(*form_structure, field, *autofill_field); | 441 GetProfileSuggestions(*form_structure, field, *autofill_field); |
| 442 } | 442 } |
| 443 if (!suggestions.empty()) { | 443 if (!suggestions.empty()) { |
| 444 // Don't provide credit card suggestions for non-secure pages. However, | 444 // Don't provide credit card suggestions for non-secure pages, but do |
| 445 // do provide a warning to the user. This will generate warnings on pages | 445 // provide them for secure pages with passive mixed content (see impl. of |
| 446 // with mixed content (which includes forms with an http target). | 446 // IsContextSecure). |
| 447 if (is_filling_credit_card && | 447 if (is_filling_credit_card && |
| 448 !client_->IsContextSecure(form_structure->source_url())) { | 448 !client_->IsContextSecure(form_structure->source_url())) { |
| 449 Suggestion warning_suggestion(l10n_util::GetStringUTF16( | 449 Suggestion warning_suggestion(l10n_util::GetStringUTF16( |
| 450 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); | 450 IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); |
| 451 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; | 451 warning_suggestion.frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE; |
| 452 suggestions.assign(1, warning_suggestion); | 452 suggestions.assign(1, warning_suggestion); |
| 453 } else { | 453 } else { |
| 454 bool section_is_autofilled = | 454 bool section_is_autofilled = |
| 455 SectionIsAutofilled(*form_structure, form, | 455 SectionIsAutofilled(*form_structure, form, |
| 456 autofill_field->section()); | 456 autofill_field->section()); |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1727 if (i > 0) | 1727 if (i > 0) |
| 1728 fputs("Next oldest form:\n", file); | 1728 fputs("Next oldest form:\n", file); |
| 1729 } | 1729 } |
| 1730 fputs("\n", file); | 1730 fputs("\n", file); |
| 1731 | 1731 |
| 1732 fclose(file); | 1732 fclose(file); |
| 1733 } | 1733 } |
| 1734 #endif // ENABLE_FORM_DEBUG_DUMP | 1734 #endif // ENABLE_FORM_DEBUG_DUMP |
| 1735 | 1735 |
| 1736 } // namespace autofill | 1736 } // namespace autofill |
| OLD | NEW |