Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "base/string16.h" | |
| 11 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 12 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 12 | 13 |
| 13 namespace views { | 14 namespace views { |
| 14 class MenuItemView; | 15 class MenuItemView; |
| 15 class MenuModelAdapter; | 16 class MenuModelAdapter; |
| 16 class MenuRunner; | 17 class MenuRunner; |
| 17 } // namespace views | 18 } // namespace views |
| 18 | 19 |
| 19 class RenderViewContextMenuViews : public RenderViewContextMenu { | 20 class RenderViewContextMenuViews : public RenderViewContextMenu { |
| 20 public: | 21 public: |
| 21 RenderViewContextMenuViews(TabContents* tab_contents, | 22 RenderViewContextMenuViews(TabContents* tab_contents, |
| 22 const ContextMenuParams& params); | 23 const ContextMenuParams& params); |
| 23 | 24 |
| 24 virtual ~RenderViewContextMenuViews(); | 25 virtual ~RenderViewContextMenuViews(); |
| 25 | 26 |
| 26 void RunMenuAt(int x, int y); | 27 void RunMenuAt(int x, int y); |
| 27 | 28 |
| 28 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
| 29 // Set this menu to show for an external tab contents. This | 30 // Set this menu to show for an external tab contents. This |
| 30 // only has an effect before Init() is called. | 31 // only has an effect before Init() is called. |
| 31 void SetExternal(); | 32 void SetExternal(); |
| 32 #endif | 33 #endif |
| 33 | 34 |
| 34 void UpdateMenuItemStates(); | 35 void UpdateMenuItemStates(); |
| 35 | 36 |
| 37 // RenderViewContextMenuDelegate implementation. | |
|
Ben Goodger (Google)
2011/08/30 17:40:35
Match the header style of the other implementation
Hironori Bono
2011/09/01 10:33:05
Done. Thanks you for noticing it. I have made the
| |
| 38 virtual void UpdateMenuItem(int command_id, | |
| 39 bool enabled, | |
| 40 const string16& title) OVERRIDE; | |
| 41 | |
| 36 protected: | 42 protected: |
| 37 // RenderViewContextMenu implementation -------------------------------------- | 43 // RenderViewContextMenu implementation -------------------------------------- |
|
Ben Goodger (Google)
2011/08/30 17:40:35
nix the ----
Hironori Bono
2011/09/01 10:33:05
Done.
| |
| 38 virtual void PlatformInit(); | 44 virtual void PlatformInit(); |
| 39 virtual bool GetAcceleratorForCommandId(int command_id, | 45 virtual bool GetAcceleratorForCommandId(int command_id, |
| 40 ui::Accelerator* accelerator); | 46 ui::Accelerator* accelerator); |
| 41 private: | 47 private: |
| 42 // The context menu itself and its contents. | 48 // The context menu itself and its contents. |
| 43 scoped_ptr<views::MenuModelAdapter> menu_delegate_; | 49 scoped_ptr<views::MenuModelAdapter> menu_delegate_; |
| 44 views::MenuItemView* menu_; // Owned by menu_runner_. | 50 views::MenuItemView* menu_; // Owned by menu_runner_. |
| 45 scoped_ptr<views::MenuRunner> menu_runner_; | 51 scoped_ptr<views::MenuRunner> menu_runner_; |
| 46 | 52 |
| 47 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); | 53 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); |
| 48 }; | 54 }; |
| 49 | 55 |
| 50 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H _ | 56 #endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_VIEWS_H _ |
| OLD | NEW |