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

Unified Diff: chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h

Issue 2688883002: Revert [MacViews] Implemented text context menu (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h
diff --git a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h
index 5cebb5c79b4748310bd7888be6c2336943293bea..05159cbe9da20ee915a378e5160fe0ee459445bd 100644
--- a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h
+++ b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h
@@ -10,37 +10,31 @@
#include "base/mac/scoped_nsobject.h"
#include "base/macros.h"
#include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
-#include "ui/base/cocoa/text_services_context_menu.h"
@class MenuController;
// Mac implementation of the context menu display code. Uses a Cocoa NSMenu
// to display the context menu. Internally uses an obj-c object as the
// target of the NSMenu, bridging back to this C++ class.
-class RenderViewContextMenuMac : public RenderViewContextMenu,
- public ui::TextServicesContextMenu::Delegate {
+class RenderViewContextMenuMac : public RenderViewContextMenu {
public:
RenderViewContextMenuMac(content::RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params,
NSView* parent_view);
~RenderViewContextMenuMac() override;
- // SimpleMenuModel::Delegate:
+ // SimpleMenuModel::Delegate implementation.
+ void ExecuteCommand(int command_id, int event_flags) override;
bool IsCommandIdChecked(int command_id) const override;
bool IsCommandIdEnabled(int command_id) const override;
- void ExecuteCommand(int command_id, int event_flags) override;
-
- // TextServicesContextMenu::Delegate:
- base::string16 GetSelectedText() const override;
- bool IsTextDirectionEnabled(
- base::i18n::TextDirection direction) const override;
- bool IsTextDirectionChecked(
- base::i18n::TextDirection direction) const override;
- void UpdateTextDirection(base::i18n::TextDirection direction) override;
- // RenderViewContextMenuBase:
+ // RenderViewContextMenuBase implementation.
void Show() override;
+ protected:
+ // RenderViewContextMenu implementation.
+ void AppendPlatformEditableItems() override;
+
private:
friend class ToolkitDelegateMac;
@@ -56,21 +50,30 @@ class RenderViewContextMenuMac : public RenderViewContextMenu,
bool hidden,
const base::string16& title);
- // Handler for the "Look Up" menu item.
+ // Adds writing direction submenu.
+ void AppendBidiSubMenu();
+
+ // Handler for the "Look Up in Dictionary" menu item.
void LookUpInDictionary();
- // Returns value of the context menu parameter associated with |direction|.
- int ParamsForTextDirection(base::i18n::TextDirection direction) const;
+ // Handler for the "Start Speaking" menu item.
+ void StartSpeaking();
+
+ // Handler for the "Stop Speaking" menu item.
+ void StopSpeaking();
// The Cocoa menu controller for this menu.
base::scoped_nsobject<MenuController> menu_controller_;
+ // Model for the "Speech" submenu.
+ ui::SimpleMenuModel speech_submenu_model_;
+
+ // Model for the BiDi input submenu.
+ ui::SimpleMenuModel bidi_submenu_model_;
+
// The Cocoa parent view.
NSView* parent_view_;
- // The context menu that adds and handles Speech, Lookup and BiDi.
- ui::TextServicesContextMenu text_services_context_menu_;
-
DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuMac);
};
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698