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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 #include "components/autofill/core/common/autofill_pref_names.h" | 55 #include "components/autofill/core/common/autofill_pref_names.h" |
56 #include "components/autofill/core/common/autofill_util.h" | 56 #include "components/autofill/core/common/autofill_util.h" |
57 #include "components/autofill/core/common/form_data.h" | 57 #include "components/autofill/core/common/form_data.h" |
58 #include "components/autofill/core/common/form_data_predictions.h" | 58 #include "components/autofill/core/common/form_data_predictions.h" |
59 #include "components/autofill/core/common/form_field_data.h" | 59 #include "components/autofill/core/common/form_field_data.h" |
60 #include "components/autofill/core/common/password_form_fill_data.h" | 60 #include "components/autofill/core/common/password_form_fill_data.h" |
61 #include "components/pref_registry/pref_registry_syncable.h" | 61 #include "components/pref_registry/pref_registry_syncable.h" |
62 #include "components/prefs/pref_service.h" | 62 #include "components/prefs/pref_service.h" |
63 #include "components/rappor/public/rappor_utils.h" | 63 #include "components/rappor/public/rappor_utils.h" |
64 #include "components/rappor/rappor_service_impl.h" | 64 #include "components/rappor/rappor_service_impl.h" |
| 65 #include "components/security_state/core/security_state.h" |
65 #include "google_apis/gaia/identity_provider.h" | 66 #include "google_apis/gaia/identity_provider.h" |
66 #include "grit/components_strings.h" | 67 #include "grit/components_strings.h" |
67 #include "ui/base/l10n/l10n_util.h" | 68 #include "ui/base/l10n/l10n_util.h" |
68 #include "ui/gfx/geometry/rect.h" | 69 #include "ui/gfx/geometry/rect.h" |
69 #include "url/gurl.h" | 70 #include "url/gurl.h" |
70 | 71 |
71 #if defined(OS_IOS) | 72 #if defined(OS_IOS) |
72 #include "components/autofill/core/browser/keyboard_accessory_metrics_logger.h" | 73 #include "components/autofill/core/browser/keyboard_accessory_metrics_logger.h" |
73 #endif | 74 #endif |
74 | 75 |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 client_->IsContextSecure(form_structure->source_url()) && | 583 client_->IsContextSecure(form_structure->source_url()) && |
583 (!form_structure->target_url().is_valid() || | 584 (!form_structure->target_url().is_valid() || |
584 !form_structure->target_url().SchemeIs("http")); | 585 !form_structure->target_url().SchemeIs("http")); |
585 if (is_filling_credit_card) | 586 if (is_filling_credit_card) |
586 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); | 587 AutofillMetrics::LogIsQueriedCreditCardFormSecure(is_context_secure); |
587 | 588 |
588 // Don't provide credit card suggestions for non-secure pages, but do | 589 // Don't provide credit card suggestions for non-secure pages, but do |
589 // provide them for secure pages with passive mixed content (see impl. of | 590 // provide them for secure pages with passive mixed content (see impl. of |
590 // IsContextSecure). | 591 // IsContextSecure). |
591 if (is_filling_credit_card && !is_context_secure) { | 592 if (is_filling_credit_card && !is_context_secure) { |
592 bool is_http_warning_enabled = IsCreditCardAutofillHttpWarningEnabled(); | 593 bool is_http_warning_enabled = |
| 594 security_state::IsHttpWarningInFormEnabled(); |
593 // Replace the suggestion content with a warning message explaining why | 595 // Replace the suggestion content with a warning message explaining why |
594 // Autofill is disabled for a website. The string is different if the | 596 // Autofill is disabled for a website. The string is different if the |
595 // credit card autofill HTTP warning experiment is enabled. | 597 // credit card autofill HTTP warning experiment is enabled. |
596 Suggestion warning_suggestion(l10n_util::GetStringUTF16( | 598 Suggestion warning_suggestion(l10n_util::GetStringUTF16( |
597 is_http_warning_enabled | 599 is_http_warning_enabled |
598 ? IDS_AUTOFILL_WARNING_PAYMENT_DISABLED | 600 ? IDS_AUTOFILL_WARNING_PAYMENT_DISABLED |
599 : IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); | 601 : IDS_AUTOFILL_WARNING_INSECURE_CONNECTION)); |
600 warning_suggestion.frontend_id = | 602 warning_suggestion.frontend_id = |
601 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE; | 603 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE; |
602 suggestions.assign(1, warning_suggestion); | 604 suggestions.assign(1, warning_suggestion); |
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2135 if (i > 0) | 2137 if (i > 0) |
2136 fputs("Next oldest form:\n", file); | 2138 fputs("Next oldest form:\n", file); |
2137 } | 2139 } |
2138 fputs("\n", file); | 2140 fputs("\n", file); |
2139 | 2141 |
2140 fclose(file); | 2142 fclose(file); |
2141 } | 2143 } |
2142 #endif // ENABLE_FORM_DEBUG_DUMP | 2144 #endif // ENABLE_FORM_DEBUG_DUMP |
2143 | 2145 |
2144 } // namespace autofill | 2146 } // namespace autofill |
OLD | NEW |