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 | 11 |
11 namespace browsing_data { | 12 namespace browsing_data { |
12 | 13 |
13 // Browsing data types as seen in the Android UI. | 14 // Browsing data types as seen in the Android UI. |
14 // TODO(msramek): Reuse this enum as the canonical representation of the | 15 // TODO(msramek): Reuse this enum as the canonical representation of the |
15 // user-facing browsing data types in the Desktop UI as well. | 16 // user-facing browsing data types in the Desktop UI as well. |
16 // | 17 // |
17 // A Java counterpart will be generated for this enum. | 18 // A Java counterpart will be generated for this enum. |
18 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.browsing_data | 19 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.browsing_data |
19 enum BrowsingDataType { | 20 enum BrowsingDataType { |
(...skipping 15 matching lines...) Expand all Loading... |
35 LAST_DAY, | 36 LAST_DAY, |
36 LAST_WEEK, | 37 LAST_WEEK, |
37 FOUR_WEEKS, | 38 FOUR_WEEKS, |
38 ALL_TIME, | 39 ALL_TIME, |
39 TIME_PERIOD_LAST = ALL_TIME | 40 TIME_PERIOD_LAST = ALL_TIME |
40 }; | 41 }; |
41 | 42 |
42 // 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|. |
43 base::Time CalculateBeginDeleteTime(TimePeriod time_period); | 44 base::Time CalculateBeginDeleteTime(TimePeriod time_period); |
44 | 45 |
| 46 // 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 |
| 48 // in components/browsing_data/core/counters. |
| 49 base::string16 GetCounterTextFromResult( |
| 50 const browsing_data::BrowsingDataCounter::Result* result); |
| 51 |
45 } // namespace browsing_data | 52 } // namespace browsing_data |
46 | 53 |
47 #endif // COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ | 54 #endif // COMPONENTS_BROWSING_DATA_CORE_BROWSING_DATA_UTILS_H_ |
OLD | NEW |