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

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

Issue 1002283004: Don't record usage stats when autofilling in incognito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/personal_data_manager.h" 5 #include "components/autofill/core/browser/personal_data_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <iterator> 9 #include <iterator>
10 10
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 if (imported_profile.get() || *imported_credit_card || merged_credit_card) 498 if (imported_profile.get() || *imported_credit_card || merged_credit_card)
499 return true; 499 return true;
500 500
501 FOR_EACH_OBSERVER(PersonalDataManagerObserver, observers_, 501 FOR_EACH_OBSERVER(PersonalDataManagerObserver, observers_,
502 OnInsufficientFormData()); 502 OnInsufficientFormData());
503 return false; 503 return false;
504 } 504 }
505 505
506 void PersonalDataManager::RecordUseOf(const AutofillDataModel& data_model) { 506 void PersonalDataManager::RecordUseOf(const AutofillDataModel& data_model) {
507 if (!database_.get()) 507 if (is_off_the_record_ || !database_.get())
508 return; 508 return;
509 509
510 CreditCard* credit_card = GetCreditCardByGUID(data_model.guid()); 510 CreditCard* credit_card = GetCreditCardByGUID(data_model.guid());
511 if (credit_card) { 511 if (credit_card) {
512 credit_card->RecordUse(); 512 credit_card->RecordUse();
513 513
514 if (credit_card->record_type() == CreditCard::LOCAL_CARD) { 514 if (credit_card->record_type() == CreditCard::LOCAL_CARD) {
515 database_->UpdateCreditCard(*credit_card); 515 database_->UpdateCreditCard(*credit_card);
516 } else if (credit_card->record_type() == CreditCard::FULL_SERVER_CARD) { 516 } else if (credit_card->record_type() == CreditCard::FULL_SERVER_CARD) {
517 database_->UpdateUnmaskedCardUsageStats(*credit_card); 517 database_->UpdateUnmaskedCardUsageStats(*credit_card);
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 } 1371 }
1372 if (IsExperimentalWalletIntegrationEnabled() && 1372 if (IsExperimentalWalletIntegrationEnabled() &&
1373 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { 1373 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) {
1374 profiles_.insert( 1374 profiles_.insert(
1375 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); 1375 profiles_.end(), server_profiles_.begin(), server_profiles_.end());
1376 } 1376 }
1377 return profiles_; 1377 return profiles_;
1378 } 1378 }
1379 1379
1380 } // namespace autofill 1380 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698