current_locale_view.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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_UNIFIED_CURRENT_LOCALE_VIEW_H_
  5. #define ASH_SYSTEM_UNIFIED_CURRENT_LOCALE_VIEW_H_
  6. #include "ash/system/model/locale_model.h"
  7. #include "ash/system/tray/tray_item_view.h"
  8. namespace ash {
  9. // The current locale view in UnifiedSystemTray button. The view shows the
  10. // abbreviation of the current locale (e.g. "DA").
  11. class CurrentLocaleView : public TrayItemView, public LocaleModel::Observer {
  12. public:
  13. explicit CurrentLocaleView(Shelf* shelf);
  14. CurrentLocaleView(const CurrentLocaleView&) = delete;
  15. CurrentLocaleView& operator=(const CurrentLocaleView&) = delete;
  16. ~CurrentLocaleView() override;
  17. // LocaleModel::Observer:
  18. void OnLocaleListSet() override;
  19. // views::TrayItemView:
  20. const char* GetClassName() const override;
  21. void HandleLocaleChange() override;
  22. };
  23. } // namespace ash
  24. #endif // ASH_SYSTEM_UNIFIED_CURRENT_LOCALE_VIEW_H_