OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ | 5 #ifndef COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ |
6 #define COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ | 6 #define COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "components/browsing_data/core/counters/browsing_data_counter.h" | 10 #include "components/browsing_data/core/counters/browsing_data_counter.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 LAST_DAY, | 36 LAST_DAY, |
37 LAST_WEEK, | 37 LAST_WEEK, |
38 FOUR_WEEKS, | 38 FOUR_WEEKS, |
39 ALL_TIME, | 39 ALL_TIME, |
40 TIME_PERIOD_LAST = ALL_TIME | 40 TIME_PERIOD_LAST = ALL_TIME |
41 }; | 41 }; |
42 | 42 |
43 // Calculate the begin time for the deletion range specified by |time_period|. | 43 // Calculate the begin time for the deletion range specified by |time_period|. |
44 base::Time CalculateBeginDeleteTime(TimePeriod time_period); | 44 base::Time CalculateBeginDeleteTime(TimePeriod time_period); |
45 | 45 |
| 46 // Calculate the end time for the deletion range specified by |time_period|. |
| 47 base::Time CalculateEndDeleteTime(TimePeriod time_period); |
| 48 |
| 49 // Records the UMA action of UI-triggered data deletion for |time_period|. |
| 50 void RecordDeletionForPeriod(TimePeriod time_period); |
| 51 |
46 // Constructs the text to be displayed by a counter from the given |result|. | 52 // Constructs the text to be displayed by a counter from the given |result|. |
47 // Currently this can only be used for counters for which the Result is defined | 53 // Currently this can only be used for counters for which the Result is defined |
48 // in components/browsing_data/core/counters. | 54 // in components/browsing_data/core/counters. |
49 base::string16 GetCounterTextFromResult( | 55 base::string16 GetCounterTextFromResult( |
50 const browsing_data::BrowsingDataCounter::Result* result); | 56 const browsing_data::BrowsingDataCounter::Result* result); |
51 | 57 |
52 // Copies the name of the deletion preference corresponding to the given | 58 // Copies the name of the deletion preference corresponding to the given |
53 // |data_type| to |out_pref|. Returns false if no such preference exists. | 59 // |data_type| to |out_pref|. Returns false if no such preference exists. |
54 bool GetDeletionPreferenceFromDataType( | 60 bool GetDeletionPreferenceFromDataType( |
55 BrowsingDataType data_type, | 61 BrowsingDataType data_type, |
56 std::string* out_pref); | 62 std::string* out_pref); |
57 | 63 |
58 } // namespace browsing_data | 64 } // namespace browsing_data |
59 | 65 |
60 #endif // COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ | 66 #endif // COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ |
OLD | NEW |