1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_GTK_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/tab_contents/render_view_context_menu.h"
11 #include "chrome/browser/ui/gtk/menu_gtk.h"
12 #include "ui/gfx/point.h"
15 class RenderWidgetHostView;
16 struct ContextMenuParams;
19 class RenderViewContextMenuGtk : public RenderViewContextMenu,
20 public MenuGtk::Delegate {
22 RenderViewContextMenuGtk(content::RenderFrameHost* render_frame_host,
23 const content::ContextMenuParams& params,
24 content::RenderWidgetHostView* view);
26 virtual ~RenderViewContextMenuGtk();
28 // Show the menu at the given location.
29 void Popup(const gfx::Point& point);
31 // Menu::Delegate implementation ---------------------------------------------
32 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE;
34 // SimpleMenuModel::Delegate implementation.
35 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
36 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
37 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
39 // RenderViewContextMenuDelegate implementation ------------------------------
40 virtual void UpdateMenuItem(int command_id,
43 const base::string16& title) OVERRIDE;
46 // RenderViewContextMenu implementation --------------------------------------
47 virtual void PlatformInit() OVERRIDE;
48 virtual void PlatformCancel() OVERRIDE;
49 // TODO(port): implement.
50 virtual bool GetAcceleratorForCommandId(
52 ui::Accelerator* accelerator) OVERRIDE;
53 virtual void AppendPlatformEditableItems() OVERRIDE;
56 // Adds writing direction submenu.
57 void AppendBidiSubMenu();
59 // Model for the BiDi input submenu.
60 ui::SimpleMenuModel bidi_submenu_model_;
62 scoped_ptr<MenuGtk> menu_gtk_;
63 uint32_t triggering_event_time_;
66 #endif // CHROME_BROWSER_UI_GTK_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_