tray_ime_chromeos.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2012 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_IME_TRAY_IME_CHROMEOS_H_
  5. #define ASH_SYSTEM_IME_TRAY_IME_CHROMEOS_H_
  6. #include <stddef.h>
  7. #include "ash/public/cpp/ime_info.h"
  8. #include "ash/system/ime_menu/ime_list_view.h"
  9. #include "ui/base/metadata/metadata_header_macros.h"
  10. namespace views {
  11. class ImageView;
  12. } // namespace views
  13. namespace ash {
  14. class ImeControllerImpl;
  15. // A list of available IMEs shown in the IME detailed view of the system menu,
  16. // along with other items in the title row (a settings button and optional
  17. // enterprise-controlled icon).
  18. class IMEDetailedView : public ImeListView {
  19. public:
  20. METADATA_HEADER(IMEDetailedView);
  21. IMEDetailedView(DetailedViewDelegate* delegate,
  22. ImeControllerImpl* ime_controller);
  23. IMEDetailedView(const IMEDetailedView&) = delete;
  24. IMEDetailedView& operator=(const IMEDetailedView&) = delete;
  25. ~IMEDetailedView() override = default;
  26. void Update(const std::string& current_ime_id,
  27. const std::vector<ImeInfo>& list,
  28. const std::vector<ImeMenuItem>& property_list,
  29. bool show_keyboard_toggle,
  30. SingleImeBehavior single_ime_behavior) override;
  31. views::ImageView* controlled_setting_icon() {
  32. return controlled_setting_icon_;
  33. }
  34. private:
  35. // ImeListView:
  36. void ResetImeListView() override;
  37. void CreateExtraTitleRowButtons() override;
  38. void ShowSettings();
  39. ImeControllerImpl* const ime_controller_;
  40. // Gear icon that takes the user to IME settings.
  41. views::Button* settings_button_ = nullptr;
  42. // This icon says that the IMEs are managed by policy.
  43. views::ImageView* controlled_setting_icon_ = nullptr;
  44. };
  45. } // namespace ash
  46. #endif // ASH_SYSTEM_IME_TRAY_IME_CHROMEOS_H_