| 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/string16.h" | 10 #include "base/string16.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 public: | 26 public: |
| 27 virtual ~RenderViewContextMenuViews(); | 27 virtual ~RenderViewContextMenuViews(); |
| 28 | 28 |
| 29 // Factory function to create an instance. | 29 // Factory function to create an instance. |
| 30 static RenderViewContextMenuViews* Create( | 30 static RenderViewContextMenuViews* Create( |
| 31 content::WebContents* tab_contents, | 31 content::WebContents* tab_contents, |
| 32 const content::ContextMenuParams& params); | 32 const content::ContextMenuParams& params); |
| 33 | 33 |
| 34 void RunMenuAt(views::Widget* parent, | 34 void RunMenuAt(views::Widget* parent, |
| 35 const gfx::Point& point, | 35 const gfx::Point& point, |
| 36 const content::ContextMenuSourceType& type); | 36 content::ContextMenuSourceType type); |
| 37 | 37 |
| 38 void UpdateMenuItemStates(); | 38 void UpdateMenuItemStates(); |
| 39 | 39 |
| 40 // RenderViewContextMenuDelegate implementation. | 40 // RenderViewContextMenuDelegate implementation. |
| 41 virtual void UpdateMenuItem(int command_id, | 41 virtual void UpdateMenuItem(int command_id, |
| 42 bool enabled, | 42 bool enabled, |
| 43 bool hidden, | 43 bool hidden, |
| 44 const string16& title) OVERRIDE; | 44 const string16& title) OVERRIDE; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 RenderViewContextMenuViews(content::WebContents* tab_contents, | 47 RenderViewContextMenuViews(content::WebContents* tab_contents, |
| 48 const content::ContextMenuParams& params); | 48 const content::ContextMenuParams& params); |
| 49 // RenderViewContextMenu implementation. | 49 // RenderViewContextMenu implementation. |
| 50 virtual void PlatformInit() OVERRIDE; | 50 virtual void PlatformInit() OVERRIDE; |
| 51 virtual void PlatformCancel() OVERRIDE; | 51 virtual void PlatformCancel() OVERRIDE; |
| 52 virtual bool GetAcceleratorForCommandId( | 52 virtual bool GetAcceleratorForCommandId( |
| 53 int command_id, | 53 int command_id, |
| 54 ui::Accelerator* accelerator) OVERRIDE; | 54 ui::Accelerator* accelerator) OVERRIDE; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // The context menu itself and its contents. | 57 // The context menu itself and its contents. |
| 58 scoped_ptr<views::MenuModelAdapter> menu_delegate_; | 58 scoped_ptr<views::MenuModelAdapter> menu_delegate_; |
| 59 views::MenuItemView* menu_; // Owned by menu_runner_. | 59 views::MenuItemView* menu_; // Owned by menu_runner_. |
| 60 scoped_ptr<views::MenuRunner> menu_runner_; | 60 scoped_ptr<views::MenuRunner> menu_runner_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); | 62 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H
_ | 65 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H
_ |
| OLD | NEW |