render_view_context_menu_gtk.h revision 3345a6884c488ff3a535c2c9acdd33d74b37e311
1// Copyright (c) 2010 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/scoped_ptr.h"
10#include "chrome/browser/gtk/menu_gtk.h"
11#include "chrome/browser/tab_contents/render_view_context_menu.h"
12#include "gfx/point.h"
13
14struct ContextMenuParams;
15
16class 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 void StoppedShowing();
30
31 protected:
32  // RenderViewContextMenu implementation --------------------------------------
33  virtual void PlatformInit();
34  // TODO(port): implement.
35  virtual bool GetAcceleratorForCommandId(
36      int command_id,
37      menus::Accelerator* accelerator) {
38    return false;
39  }
40
41 private:
42  scoped_ptr<MenuGtk> menu_gtk_;
43  uint32_t triggering_event_time_;
44};
45
46#endif  // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_
47