1 // Copyright (c) 2011 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 CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ 7 #pragma once 8 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" 13 14 struct ContextMenuParams; 15 16 class RenderViewContextMenuGtk : public RenderViewContextMenu, 17 public MenuGtk::Delegate { 18 public: 19 RenderViewContextMenuGtk(TabContents* web_contents, 20 const ContextMenuParams& params, 21 uint32_t triggering_event_time); 22 23 ~RenderViewContextMenuGtk(); 24 25 // Show the menu at the given location. 26 void Popup(const gfx::Point& point); 27 28 // Menu::Delegate implementation --------------------------------------------- 29 virtual bool AlwaysShowIconForCmd(int command_id) const; 30 31 protected: 32 // RenderViewContextMenu implementation -------------------------------------- 33 virtual void PlatformInit(); 34 // TODO(port): implement. 35 virtual bool GetAcceleratorForCommandId( 36 int command_id, 37 ui::Accelerator* accelerator); 38 39 private: 40 scoped_ptr<MenuGtk> menu_gtk_; 41 uint32_t triggering_event_time_; 42 }; 43 44 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ 45