| 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_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.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 "content/public/common/context_menu_source_type.h" | 12 #include "ui/base/ui_base_types.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Point; | 15 class Point; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 class MenuRunner; | 19 class MenuRunner; |
| 20 class Widget; | 20 class Widget; |
| 21 } | 21 } |
| 22 | 22 |
| 23 class RenderViewContextMenuViews : public RenderViewContextMenu { | 23 class RenderViewContextMenuViews : public RenderViewContextMenu { |
| 24 public: | 24 public: |
| 25 virtual ~RenderViewContextMenuViews(); | 25 virtual ~RenderViewContextMenuViews(); |
| 26 | 26 |
| 27 // Factory function to create an instance. | 27 // Factory function to create an instance. |
| 28 static RenderViewContextMenuViews* Create( | 28 static RenderViewContextMenuViews* Create( |
| 29 content::WebContents* web_contents, | 29 content::WebContents* web_contents, |
| 30 const content::ContextMenuParams& params); | 30 const content::ContextMenuParams& params); |
| 31 | 31 |
| 32 void RunMenuAt(views::Widget* parent, | 32 void RunMenuAt(views::Widget* parent, |
| 33 const gfx::Point& point, | 33 const gfx::Point& point, |
| 34 content::ContextMenuSourceType type); | 34 ui::MenuSourceType type); |
| 35 | 35 |
| 36 // RenderViewContextMenuDelegate implementation. | 36 // RenderViewContextMenuDelegate implementation. |
| 37 virtual void UpdateMenuItem(int command_id, | 37 virtual void UpdateMenuItem(int command_id, |
| 38 bool enabled, | 38 bool enabled, |
| 39 bool hidden, | 39 bool hidden, |
| 40 const string16& title) OVERRIDE; | 40 const string16& title) OVERRIDE; |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 RenderViewContextMenuViews(content::WebContents* web_contents, | 43 RenderViewContextMenuViews(content::WebContents* web_contents, |
| 44 const content::ContextMenuParams& params); | 44 const content::ContextMenuParams& params); |
| 45 // RenderViewContextMenu implementation. | 45 // RenderViewContextMenu implementation. |
| 46 virtual void PlatformInit() OVERRIDE; | 46 virtual void PlatformInit() OVERRIDE; |
| 47 virtual void PlatformCancel() OVERRIDE; | 47 virtual void PlatformCancel() OVERRIDE; |
| 48 virtual bool GetAcceleratorForCommandId( | 48 virtual bool GetAcceleratorForCommandId( |
| 49 int command_id, | 49 int command_id, |
| 50 ui::Accelerator* accelerator) OVERRIDE; | 50 ui::Accelerator* accelerator) OVERRIDE; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 scoped_ptr<views::MenuRunner> menu_runner_; | 53 scoped_ptr<views::MenuRunner> menu_runner_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); | 55 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H
_ | 58 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H
_ |
| OLD | NEW |