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

Unified Diff: components/autofill/core/browser/autofill_profile.cc

Issue 2864363004: Adds UMA for days since previous use to help us determine the validity (Closed)
Patch Set: Merge forward. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/autofill_profile.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_profile.cc
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index 4ef1222b02a7153bde6d1cdbfb1f74d10adcb606..e54c9fdab7d779a7538e5f10b9283c578f8b3754 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -195,23 +195,23 @@ void GetFieldsForDistinguishingProfiles(
AutofillProfile::AutofillProfile(const std::string& guid,
const std::string& origin)
: AutofillDataModel(guid, origin),
- record_type_(LOCAL_PROFILE),
phone_number_(this),
+ record_type_(LOCAL_PROFILE),
has_converted_(false) {}
AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id)
: AutofillDataModel(base::GenerateGUID(), std::string()),
- record_type_(type),
phone_number_(this),
server_id_(server_id),
+ record_type_(type),
has_converted_(false) {
DCHECK(type == SERVER_PROFILE);
}
AutofillProfile::AutofillProfile()
: AutofillDataModel(base::GenerateGUID(), std::string()),
- record_type_(LOCAL_PROFILE),
phone_number_(this),
+ record_type_(LOCAL_PROFILE),
has_converted_(false) {}
AutofillProfile::AutofillProfile(const AutofillProfile& profile)
@@ -225,6 +225,7 @@ AutofillProfile::~AutofillProfile() {
AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) {
set_use_count(profile.use_count());
set_use_date(profile.use_date());
+ set_previous_use_date(profile.previous_use_date());
set_modification_date(profile.modification_date());
if (this == &profile)
@@ -702,6 +703,7 @@ void AutofillProfile::GenerateServerProfileIdentifier() {
}
void AutofillProfile::RecordAndLogUse() {
+ previous_use_date_ = use_date();
UMA_HISTOGRAM_COUNTS_1000("Autofill.DaysSinceLastUse.Profile",
(AutofillClock::Now() - use_date()).InDays());
RecordUse();
« no previous file with comments | « components/autofill/core/browser/autofill_profile.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698