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

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: Addressed tapted's comments and added a test 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 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>
msw 2017/01/26 20:59:16 nit: remove
spqchan 2017/02/01 00:32:38 I need it for std::unique_ptr. Should I use someth
msw 2017/02/01 01:52:28 Ah, I missed that; thanks for pointing it out.
9
10 #include "base/i18n/rtl.h"
11 #include "ui/views/views_export.h"
msw 2017/01/26 20:59:16 nit: remove if export isn't needed
spqchan 2017/02/01 00:32:38 Done.
12
13 namespace ui {
14 class SimpleMenuModel;
15 }
16
17 namespace views {
18
19 class Textfield;
20
21 // This class is used to add and handle text service items in the text context
22 // menu.
23 class ViewsTextServicesContextMenu {
24 public:
25 virtual ~ViewsTextServicesContextMenu() {}
26
27 // Creates a ViewsTextContextMenu object.
msw 2017/01/26 20:59:16 nit: ViewsTextServicesContextMenu
spqchan 2017/02/01 00:32:38 Done.
28 static std::unique_ptr<ViewsTextServicesContextMenu> Create(
29 ui::SimpleMenuModel* menu,
30 Textfield* textfield);
31
32 // Returns true if the given |command_id| is handled by the menu.
33 virtual bool HandlesCommandId(int command_id) const = 0;
34
35 // Methods associated with SimpleMenuModel::Delegate.
36 virtual bool IsCommandIdChecked(int command_id) const = 0;
37 virtual bool IsCommandIdEnabled(int command_id) const = 0;
38 virtual void ExecuteCommand(int command_id, int event_flags) = 0;
39
40 // Exposed for testing. Returns true if the text direction BiDi submenu
41 // item should be checked.
42 virtual bool IsTextDirectionItemChecked(
msw 2017/01/26 20:59:16 nit: IsTextDirectionItemCheckedForTest[ing]
spqchan 2017/02/01 00:32:38 Done.
43 base::i18n::TextDirection direction) const = 0;
44 };
45
46 } // namespace views
47
48 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_VIEWS_TEXT_SERVICES_CONTEXT_MENU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698