OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 "ui/views/views_export.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 ViewsTextContextMenu 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 void ExecuteCommand(int command_id, int event_flags) = 0; | |
tapted
2016/12/21 11:20:27
nit: reorder to match
spqchan
2016/12/21 22:00:14
Done.
| |
36 virtual bool IsCommandIdChecked(int command_id) const = 0; | |
37 virtual bool IsCommandIdEnabled(int command_id) const = 0; | |
38 }; | |
39 | |
40 } // namespace views | |
41 | |
42 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_ | |
OLD | NEW |