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

Side by Side Diff: ui/base/cocoa/text_context_menu.h

Issue 2164483006: [MacViews] Implemented text context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ditto Created 4 years, 5 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_BASE_COCOA_TEXT_CONTEXT_MENU_H_
6 #define UI_BASE_COCOA_TEXT_CONTEXT_MENU_H_
7
8 #include "base/macros.h"
9 #include "base/strings/sys_string_conversions.h"
10 #include "ui/base/models/simple_menu_model.h"
11
12 class TextContextMenu : public ui::SimpleMenuModel::Delegate {
tapted 2016/07/22 03:06:42 Maybe TextServicesContextMenu? (also namespace ui.
spqchan 2016/12/12 19:32:27 Done.
13 public:
14 class UI_BASE_EXPORT Delegate {
15 public:
16 virtual void StartSpeaking() = 0;
tapted 2016/07/22 03:06:42 I think we should rename this to something like O
spqchan 2016/12/12 19:32:27 Done.
17 };
18
19 TextContextMenu(Delegate* delegate);
tapted 2016/07/22 03:06:42 explicit
spqchan 2016/12/12 19:32:27 Done.
20
21 void AppendToContextMenu(ui::SimpleMenuModel* model);
22
23 static void SpeakText(const base::string16& text);
24 static void StopSpeaking();
25
26 static bool SupportsSpeech();
27 static bool IsSpeaking();
28
29 // SimpleMenuModel::Delegate implementation.
30 void ExecuteCommand(int command_id, int event_flags) override;
31 bool IsCommandIdChecked(int command_id) const override;
32 bool IsCommandIdEnabled(int command_id) const override;
33
34 protected:
35 bool GetAcceleratorForCommandId(int command_id,
36 ui::Accelerator* accelerator) override;
37
38 private:
39 // Model for the "Speech" submenu.
40 ui::SimpleMenuModel speech_submenu_model_;
41
42 Delegate* delegate_; // weak
43
44 DISALLOW_COPY_AND_ASSIGN(TextContextMenu);
45 };
46
47 #endif // UI_BASE_COCOA_TEXT_CONTEXT_MENU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698