views_text_services_context_menu_impl.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2021 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_PUBLIC_CPP_VIEWS_TEXT_SERVICES_CONTEXT_MENU_IMPL_H_
  5. #define ASH_PUBLIC_CPP_VIEWS_TEXT_SERVICES_CONTEXT_MENU_IMPL_H_
  6. #include "ash/public/cpp/ash_public_export.h"
  7. #include "ui/views/controls/views_text_services_context_menu_base.h"
  8. namespace views {
  9. class Textfield;
  10. }
  11. namespace ash {
  12. // This class supports the text context menu with the exclusive functions under
  13. // the CrOS environment.
  14. class ASH_PUBLIC_EXPORT ViewsTextServicesContextMenuImpl
  15. : public views::ViewsTextServicesContextMenuBase {
  16. public:
  17. ViewsTextServicesContextMenuImpl(ui::SimpleMenuModel* menu,
  18. views::Textfield* client);
  19. ViewsTextServicesContextMenuImpl(const ViewsTextServicesContextMenuImpl&) =
  20. delete;
  21. ViewsTextServicesContextMenuImpl& operator=(
  22. const ViewsTextServicesContextMenuImpl&) = delete;
  23. ~ViewsTextServicesContextMenuImpl() override;
  24. // ViewsTextServicesContextMenuBase:
  25. bool GetAcceleratorForCommandId(int command_id,
  26. ui::Accelerator* accelerator) const override;
  27. bool IsCommandIdChecked(int command_id) const override;
  28. bool IsCommandIdEnabled(int command_id) const override;
  29. void ExecuteCommand(int command_id, int event_flags) override;
  30. bool SupportsCommand(int command_id) const override;
  31. private:
  32. // Adds the menu option which shows the clipboard history menu after
  33. // activation.
  34. void AddClipboardHistoryMenuOption(ui::SimpleMenuModel* menu);
  35. };
  36. } // namespace ash
  37. #endif // ASH_PUBLIC_CPP_VIEWS_TEXT_SERVICES_CONTEXT_MENU_IMPL_H_