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

Unified Diff: components/browsing_data/core/browsing_data_utils.cc

Issue 2578723002: Reduce BrowsingDataRemover's dependencies on Chrome (Closed)
Patch Set: A new callsite appeared through rebase - fixed the compilation error. Created 3 years, 12 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/browsing_data/core/browsing_data_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « components/browsing_data/core/browsing_data_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698