Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: ui/views/controls/views_text_services_context_menu.h

Issue 2164483006: [MacViews] Implemented text context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | ui/views/controls/views_text_services_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698