Index: components/browsing_data/core/browsing_data_utils.cc |
diff --git a/components/browsing_data/core/browsing_data_utils.cc b/components/browsing_data/core/browsing_data_utils.cc |
index b5b472bc19c6eb19ae28b2649e40d3f73168762d..dfd254055927b8c416302e860e7334b12a7a6337 100644 |
--- a/components/browsing_data/core/browsing_data_utils.cc |
+++ b/components/browsing_data/core/browsing_data_utils.cc |
@@ -4,6 +4,7 @@ |
#include "components/browsing_data/core/browsing_data_utils.h" |
+#include "base/metrics/user_metrics.h" |
#include "components/browsing_data/core/counters/autofill_counter.h" |
#include "components/browsing_data/core/counters/history_counter.h" |
#include "components/browsing_data/core/counters/passwords_counter.h" |
@@ -36,6 +37,33 @@ base::Time CalculateBeginDeleteTime(TimePeriod time_period) { |
return delete_begin_time - diff; |
} |
+base::Time CalculateEndDeleteTime(TimePeriod time_period) { |
+ // No TimePeriod currently supports the second time bound. |
+ return base::Time::Max(); |
+} |
+ |
+void RecordDeletionForPeriod(TimePeriod period) { |
+ switch (period) { |
+ case browsing_data::LAST_HOUR: |
+ base::RecordAction(base::UserMetricsAction("ClearBrowsingData_LastHour")); |
+ break; |
+ case browsing_data::LAST_DAY: |
+ base::RecordAction(base::UserMetricsAction("ClearBrowsingData_LastDay")); |
+ break; |
+ case browsing_data::LAST_WEEK: |
+ base::RecordAction(base::UserMetricsAction("ClearBrowsingData_LastWeek")); |
+ break; |
+ case browsing_data::FOUR_WEEKS: |
+ base::RecordAction( |
+ base::UserMetricsAction("ClearBrowsingData_LastMonth")); |
+ break; |
+ case browsing_data::ALL_TIME: |
+ base::RecordAction( |
+ base::UserMetricsAction("ClearBrowsingData_Everything")); |
+ break; |
+ } |
+} |
+ |
base::string16 GetCounterTextFromResult( |
const browsing_data::BrowsingDataCounter::Result* result) { |
base::string16 text; |