1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_METRICS_DATE_CHANGED_HELPER_H_
6 #define COMPONENTS_METRICS_DATE_CHANGED_HELPER_H_
8 class PrefRegistrySimple;
13 namespace date_changed_helper {
15 // Returns whether the local date has changed since last time this was called
16 // for the given |pref_name|. Simple alternative to |DailyEvent|.
17 // TODO: Consider adding an enum param to distinguish has-date-changed from
18 // has-day-elapsed if needed by consumers of this API.
19 bool HasDateChangedSinceLastCall(PrefService* pref_service,
20 const char* pref_name);
22 // Registers the preference used by this helper.
23 void RegisterPref(PrefRegistrySimple* registry, const char* pref_name);
25 } // namespace date_changed_helper
27 } // namespace metrics
29 #endif // COMPONENTS_METRICS_DATE_CHANGED_HELPER_H_