Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2688053003: Record Autofill form events specially for nonsecure pages (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 driver_->DidInteractWithCreditCardForm(); 559 driver_->DidInteractWithCreditCardForm();
560 credit_card_form_event_logger_->OnDidInteractWithAutofillableForm(); 560 credit_card_form_event_logger_->OnDidInteractWithAutofillableForm();
561 } else { 561 } else {
562 address_form_event_logger_->OnDidInteractWithAutofillableForm(); 562 address_form_event_logger_->OnDidInteractWithAutofillableForm();
563 } 563 }
564 } 564 }
565 565
566 std::vector<Suggestion> suggestions; 566 std::vector<Suggestion> suggestions;
567 const bool is_context_secure = 567 const bool is_context_secure =
568 !form_structure || 568 !form_structure ||
569 (client_->IsContextSecure(form_structure->source_url()) && 569 (client_->IsContextSecure() &&
570 (!form_structure->target_url().is_valid() || 570 (!form_structure->target_url().is_valid() ||
571 !form_structure->target_url().SchemeIs("http"))); 571 !form_structure->target_url().SchemeIs("http")));
572 const bool is_http_warning_enabled = 572 const bool is_http_warning_enabled =
573 security_state::IsHttpWarningInFormEnabled(); 573 security_state::IsHttpWarningInFormEnabled();
574 574
575 if (is_autofill_possible && 575 if (is_autofill_possible &&
576 driver_->RendererIsAvailable() && 576 driver_->RendererIsAvailable() &&
577 got_autofillable_form) { 577 got_autofillable_form) {
578 // On desktop, don't return non credit card related suggestions for forms or 578 // On desktop, don't return non credit card related suggestions for forms or
579 // fields that have the "autocomplete" attribute set to off. 579 // fields that have the "autocomplete" attribute set to off.
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 for (CreditCard* credit_card : credit_cards) { 1432 for (CreditCard* credit_card : credit_cards) {
1433 if (credit_card->record_type() == CreditCard::LOCAL_CARD) 1433 if (credit_card->record_type() == CreditCard::LOCAL_CARD)
1434 is_local_data_available = true; 1434 is_local_data_available = true;
1435 else 1435 else
1436 is_server_data_available = true; 1436 is_server_data_available = true;
1437 } 1437 }
1438 credit_card_form_event_logger_->set_is_server_data_available( 1438 credit_card_form_event_logger_->set_is_server_data_available(
1439 is_server_data_available); 1439 is_server_data_available);
1440 credit_card_form_event_logger_->set_is_local_data_available( 1440 credit_card_form_event_logger_->set_is_local_data_available(
1441 is_local_data_available); 1441 is_local_data_available);
1442 credit_card_form_event_logger_->set_is_context_secure(
1443 client_->IsContextSecure());
1442 } 1444 }
1443 { 1445 {
1444 bool is_server_data_available = false; 1446 bool is_server_data_available = false;
1445 bool is_local_data_available = false; 1447 bool is_local_data_available = false;
1446 for (AutofillProfile* profile : profiles) { 1448 for (AutofillProfile* profile : profiles) {
1447 if (profile->record_type() == AutofillProfile::LOCAL_PROFILE) 1449 if (profile->record_type() == AutofillProfile::LOCAL_PROFILE)
1448 is_local_data_available = true; 1450 is_local_data_available = true;
1449 else if (profile->record_type() == AutofillProfile::SERVER_PROFILE) 1451 else if (profile->record_type() == AutofillProfile::SERVER_PROFILE)
1450 is_server_data_available = true; 1452 is_server_data_available = true;
1451 } 1453 }
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 if (i > 0) 2145 if (i > 0)
2144 fputs("Next oldest form:\n", file); 2146 fputs("Next oldest form:\n", file);
2145 } 2147 }
2146 fputs("\n", file); 2148 fputs("\n", file);
2147 2149
2148 fclose(file); 2150 fclose(file);
2149 } 2151 }
2150 #endif // ENABLE_FORM_DEBUG_DUMP 2152 #endif // ENABLE_FORM_DEBUG_DUMP
2151 2153
2152 } // namespace autofill 2154 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_client.h ('k') | components/autofill/core/browser/autofill_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698