#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/functional/callback.h"
namespace base {
class BASE_EXPORT FuchsiaIntlProfileWatcher {
public:
using ProfileChangeCallback =
base::RepeatingCallback<void(const ::fuchsia::intl::Profile&)>;
explicit FuchsiaIntlProfileWatcher(ProfileChangeCallback on_profile_changed);
FuchsiaIntlProfileWatcher(const FuchsiaIntlProfileWatcher&) = delete;
FuchsiaIntlProfileWatcher& operator=(const FuchsiaIntlProfileWatcher&) =
delete;
~FuchsiaIntlProfileWatcher();
static std::string GetPrimaryTimeZoneIdFromProfile(
const ::fuchsia::intl::Profile& profile);
static std::string GetPrimaryTimeZoneIdForIcuInitialization();
static std::string GetPrimaryLocaleIdFromProfile(
const ::fuchsia::intl::Profile& profile);
static std::string GetPrimaryLocaleIdForInitialization();
private:
friend class GetValuesFromIntlPropertyProviderTest;
friend class IntlProfileWatcherTest;
FuchsiaIntlProfileWatcher(
::fuchsia::intl::PropertyProviderPtr property_provider,
ProfileChangeCallback on_profile_changed);
static ::fuchsia::intl::Profile GetProfileFromPropertyProvider(
::fuchsia::intl::PropertyProviderSyncPtr property_provider);
static ::fuchsia::intl::Profile GetCurrentProfileSync();
::fuchsia::intl::PropertyProviderPtr property_provider_;
const ProfileChangeCallback on_profile_changed_;
};
}
#endif