123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef BASE_FUCHSIA_INTL_PROFILE_WATCHER_H_
- #define BASE_FUCHSIA_INTL_PROFILE_WATCHER_H_
- #include <fuchsia/intl/cpp/fidl.h>
- #include <string>
- #include "base/base_export.h"
- #include "base/callback.h"
- #include "base/strings/string_piece_forward.h"
- namespace base {
- namespace fuchsia {
- class BASE_EXPORT IntlProfileWatcher {
- public:
- using ProfileChangeCallback =
- base::RepeatingCallback<void(const ::fuchsia::intl::Profile&)>;
-
- explicit IntlProfileWatcher(ProfileChangeCallback on_profile_changed);
- IntlProfileWatcher(const IntlProfileWatcher&) = delete;
- IntlProfileWatcher& operator=(const IntlProfileWatcher&) = delete;
- ~IntlProfileWatcher();
-
-
- static std::string GetPrimaryTimeZoneIdFromProfile(
- const ::fuchsia::intl::Profile& profile);
-
-
-
-
- static std::string GetPrimaryTimeZoneIdForIcuInitialization();
- private:
- friend class GetPrimaryTimeZoneIdFromPropertyProviderTest;
- friend class IntlProfileWatcherTest;
- IntlProfileWatcher(::fuchsia::intl::PropertyProviderPtr property_provider,
- ProfileChangeCallback on_profile_changed);
-
-
- static std::string GetPrimaryTimeZoneIdFromPropertyProvider(
- ::fuchsia::intl::PropertyProviderSyncPtr property_provider);
- ::fuchsia::intl::PropertyProviderPtr property_provider_;
- const ProfileChangeCallback on_profile_changed_;
- };
- }
- }
- #endif
|