| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 is_filling_credit_card = true; | 557 is_filling_credit_card = true; |
| 558 driver_->DidInteractWithCreditCardForm(); | 558 driver_->DidInteractWithCreditCardForm(); |
| 559 credit_card_form_event_logger_->OnDidInteractWithAutofillableForm(); | 559 credit_card_form_event_logger_->OnDidInteractWithAutofillableForm(); |
| 560 } else { | 560 } else { |
| 561 address_form_event_logger_->OnDidInteractWithAutofillableForm(); | 561 address_form_event_logger_->OnDidInteractWithAutofillableForm(); |
| 562 } | 562 } |
| 563 } | 563 } |
| 564 | 564 |
| 565 std::vector<Suggestion> suggestions; | 565 std::vector<Suggestion> suggestions; |
| 566 const bool is_context_secure = | 566 const bool is_context_secure = |
| 567 !form_structure || | 567 !form_structure || (client_->IsContextSecure() && |
| 568 (client_->IsContextSecure(form_structure->source_url()) && | 568 (!form_structure->target_url().is_valid() || |
| 569 (!form_structure->target_url().is_valid() || | 569 !form_structure->target_url().SchemeIs("http"))); |
| 570 !form_structure->target_url().SchemeIs("http"))); | |
| 571 const bool is_http_warning_enabled = | 570 const bool is_http_warning_enabled = |
| 572 security_state::IsHttpWarningInFormEnabled(); | 571 security_state::IsHttpWarningInFormEnabled(); |
| 573 | 572 |
| 574 // TODO(rogerm): Early exit here on !driver_->RendererIsAvailable()? | 573 // TODO(rogerm): Early exit here on !driver_->RendererIsAvailable()? |
| 575 // We skip populating autofill data, but might generate warnings and or | 574 // We skip populating autofill data, but might generate warnings and or |
| 576 // signin promo to show over the unavailable renderer. That seems a mistake. | 575 // signin promo to show over the unavailable renderer. That seems a mistake. |
| 577 | 576 |
| 578 if (is_autofill_possible && | 577 if (is_autofill_possible && |
| 579 driver_->RendererIsAvailable() && | 578 driver_->RendererIsAvailable() && |
| 580 got_autofillable_form) { | 579 got_autofillable_form) { |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 for (CreditCard* credit_card : credit_cards) { | 1458 for (CreditCard* credit_card : credit_cards) { |
| 1460 if (credit_card->record_type() == CreditCard::LOCAL_CARD) | 1459 if (credit_card->record_type() == CreditCard::LOCAL_CARD) |
| 1461 is_local_data_available = true; | 1460 is_local_data_available = true; |
| 1462 else | 1461 else |
| 1463 is_server_data_available = true; | 1462 is_server_data_available = true; |
| 1464 } | 1463 } |
| 1465 credit_card_form_event_logger_->set_is_server_data_available( | 1464 credit_card_form_event_logger_->set_is_server_data_available( |
| 1466 is_server_data_available); | 1465 is_server_data_available); |
| 1467 credit_card_form_event_logger_->set_is_local_data_available( | 1466 credit_card_form_event_logger_->set_is_local_data_available( |
| 1468 is_local_data_available); | 1467 is_local_data_available); |
| 1468 credit_card_form_event_logger_->set_is_context_secure( |
| 1469 client_->IsContextSecure()); |
| 1469 } | 1470 } |
| 1470 { | 1471 { |
| 1471 bool is_server_data_available = false; | 1472 bool is_server_data_available = false; |
| 1472 bool is_local_data_available = false; | 1473 bool is_local_data_available = false; |
| 1473 for (AutofillProfile* profile : profiles) { | 1474 for (AutofillProfile* profile : profiles) { |
| 1474 if (profile->record_type() == AutofillProfile::LOCAL_PROFILE) | 1475 if (profile->record_type() == AutofillProfile::LOCAL_PROFILE) |
| 1475 is_local_data_available = true; | 1476 is_local_data_available = true; |
| 1476 else if (profile->record_type() == AutofillProfile::SERVER_PROFILE) | 1477 else if (profile->record_type() == AutofillProfile::SERVER_PROFILE) |
| 1477 is_server_data_available = true; | 1478 is_server_data_available = true; |
| 1478 } | 1479 } |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 if (i > 0) | 2171 if (i > 0) |
| 2171 fputs("Next oldest form:\n", file); | 2172 fputs("Next oldest form:\n", file); |
| 2172 } | 2173 } |
| 2173 fputs("\n", file); | 2174 fputs("\n", file); |
| 2174 | 2175 |
| 2175 fclose(file); | 2176 fclose(file); |
| 2176 } | 2177 } |
| 2177 #endif // ENABLE_FORM_DEBUG_DUMP | 2178 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2178 | 2179 |
| 2179 } // namespace autofill | 2180 } // namespace autofill |
| OLD | NEW |