| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ |
| 6 #define 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 | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 11 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 12 #include "chrome/browser/ui/gtk/menu_gtk.h" | 12 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 13 #include "ui/gfx/point.h" | 13 #include "ui/gfx/point.h" |
| 14 | 14 |
| 15 namespace content { |
| 15 class RenderWidgetHostView; | 16 class RenderWidgetHostView; |
| 16 | |
| 17 namespace content { | |
| 18 struct ContextMenuParams; | 17 struct ContextMenuParams; |
| 19 } | 18 } |
| 20 | 19 |
| 21 class RenderViewContextMenuGtk : public RenderViewContextMenu, | 20 class RenderViewContextMenuGtk : public RenderViewContextMenu, |
| 22 public MenuGtk::Delegate { | 21 public MenuGtk::Delegate { |
| 23 public: | 22 public: |
| 24 RenderViewContextMenuGtk(content::WebContents* web_contents, | 23 RenderViewContextMenuGtk(content::WebContents* web_contents, |
| 25 const content::ContextMenuParams& params, | 24 const content::ContextMenuParams& params, |
| 26 RenderWidgetHostView* view); | 25 content::RenderWidgetHostView* view); |
| 27 | 26 |
| 28 virtual ~RenderViewContextMenuGtk(); | 27 virtual ~RenderViewContextMenuGtk(); |
| 29 | 28 |
| 30 // Show the menu at the given location. | 29 // Show the menu at the given location. |
| 31 void Popup(const gfx::Point& point); | 30 void Popup(const gfx::Point& point); |
| 32 | 31 |
| 33 // Menu::Delegate implementation --------------------------------------------- | 32 // Menu::Delegate implementation --------------------------------------------- |
| 34 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE; | 33 virtual bool AlwaysShowIconForCmd(int command_id) const OVERRIDE; |
| 35 | 34 |
| 36 // RenderViewContextMenuDelegate implementation ------------------------------ | 35 // RenderViewContextMenuDelegate implementation ------------------------------ |
| 37 virtual void UpdateMenuItem(int command_id, | 36 virtual void UpdateMenuItem(int command_id, |
| 38 bool enabled, | 37 bool enabled, |
| 39 bool hidden, | 38 bool hidden, |
| 40 const string16& title) OVERRIDE; | 39 const string16& title) OVERRIDE; |
| 41 | 40 |
| 42 protected: | 41 protected: |
| 43 // RenderViewContextMenu implementation -------------------------------------- | 42 // RenderViewContextMenu implementation -------------------------------------- |
| 44 virtual void PlatformInit() OVERRIDE; | 43 virtual void PlatformInit() OVERRIDE; |
| 45 // TODO(port): implement. | 44 // TODO(port): implement. |
| 46 virtual bool GetAcceleratorForCommandId( | 45 virtual bool GetAcceleratorForCommandId( |
| 47 int command_id, | 46 int command_id, |
| 48 ui::Accelerator* accelerator) OVERRIDE; | 47 ui::Accelerator* accelerator) OVERRIDE; |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 scoped_ptr<MenuGtk> menu_gtk_; | 50 scoped_ptr<MenuGtk> menu_gtk_; |
| 52 uint32_t triggering_event_time_; | 51 uint32_t triggering_event_time_; |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ | 54 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_GTK_H_ |
| OLD | NEW |