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. 4 5 #ifndef COMPONENTS_METRICS_DATE_CHANGED_HELPER_H_ 6 #define COMPONENTS_METRICS_DATE_CHANGED_HELPER_H_ 7 8 class PrefRegistrySimple; 9 class PrefService; 10 11 namespace metrics { 12 13 namespace date_changed_helper { 14 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); 21 22 // Registers the preference used by this helper. 23 void RegisterPref(PrefRegistrySimple* registry, const char* pref_name); 24 25 } // namespace date_changed_helper 26 27 } // namespace metrics 28 29 #endif // COMPONENTS_METRICS_DATE_CHANGED_HELPER_H_ 30