| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 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 | |
| 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ | |
| 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/i18n/rtl.h" | |
| 11 | |
| 12 namespace ui { | |
| 13 class SimpleMenuModel; | |
| 14 } | |
| 15 | |
| 16 namespace views { | |
| 17 | |
| 18 class Textfield; | |
| 19 | |
| 20 // This class is used to add and handle text service items in the text context | |
| 21 // menu. | |
| 22 class ViewsTextServicesContextMenu { | |
| 23 public: | |
| 24 virtual ~ViewsTextServicesContextMenu() {} | |
| 25 | |
| 26 // Creates a ViewsTextServicesContextMenu object. | |
| 27 static std::unique_ptr<ViewsTextServicesContextMenu> Create( | |
| 28 ui::SimpleMenuModel* menu, | |
| 29 Textfield* textfield); | |
| 30 | |
| 31 // Returns true if the given |command_id| is handled by the menu. | |
| 32 virtual bool HandlesCommandId(int command_id) const = 0; | |
| 33 | |
| 34 // Methods associated with SimpleMenuModel::Delegate. | |
| 35 virtual bool IsCommandIdChecked(int command_id) const = 0; | |
| 36 virtual bool IsCommandIdEnabled(int command_id) const = 0; | |
| 37 virtual void ExecuteCommand(int command_id, int event_flags) = 0; | |
| 38 | |
| 39 // Exposed for testing. Returns true if the text direction BiDi submenu | |
| 40 // item should be checked. | |
| 41 virtual bool IsTextDirectionCheckedForTesting( | |
| 42 base::i18n::TextDirection direction) const = 0; | |
| 43 }; | |
| 44 | |
| 45 } // namespace views | |
| 46 | |
| 47 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ | |
| OLD | NEW |