locale_update_controller_impl.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_SYSTEM_LOCALE_LOCALE_UPDATE_CONTROLLER_IMPL_H_
  5. #define ASH_SYSTEM_LOCALE_LOCALE_UPDATE_CONTROLLER_IMPL_H_
  6. #include <string>
  7. #include "ash/public/cpp/locale_update_controller.h"
  8. #include "base/observer_list.h"
  9. namespace ash {
  10. // Observes and handles locale change events.
  11. class LocaleUpdateControllerImpl : public LocaleUpdateController {
  12. public:
  13. LocaleUpdateControllerImpl();
  14. LocaleUpdateControllerImpl(const LocaleUpdateControllerImpl&) = delete;
  15. LocaleUpdateControllerImpl& operator=(const LocaleUpdateControllerImpl&) =
  16. delete;
  17. ~LocaleUpdateControllerImpl() override;
  18. // LocaleUpdateController:
  19. void AddObserver(LocaleChangeObserver* observer) override;
  20. void RemoveObserver(LocaleChangeObserver* observer) override;
  21. private:
  22. // LocaleUpdateController:
  23. void OnLocaleChanged() override;
  24. void ConfirmLocaleChange(const std::string& current_locale,
  25. const std::string& from_locale,
  26. const std::string& to_locale,
  27. LocaleChangeConfirmationCallback callback) override;
  28. base::ObserverList<LocaleChangeObserver>::Unchecked observers_;
  29. };
  30. } // namespace ash
  31. #endif // ASH_SYSTEM_LOCALE_LOCALE_UPDATE_CONTROLLER_IMPL_H_