| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_WIN_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_WIN_H_ |
| 6 #define CHROME_BROWSER_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_WIN_H_ | 6 #define CHROME_BROWSER_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_WIN_H_ |
| 7 | 7 |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/scoped_vector.h" | 9 #include "base/scoped_vector.h" |
| 10 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 10 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 11 #include "views/accelerator.h" | 11 #include "views/accelerator.h" |
| 12 #include "views/controls/menu/simple_menu_model.h" | 12 #include "views/controls/menu/simple_menu_model.h" |
| 13 | 13 |
| 14 class RenderViewContextMenuWin : public RenderViewContextMenu, | 14 class RenderViewContextMenuWin : public RenderViewContextMenu, |
| 15 public views::SimpleMenuModel::Delegate { | 15 public views::SimpleMenuModel::Delegate { |
| 16 public: | 16 public: |
| 17 RenderViewContextMenuWin(TabContents* tab_contents, | 17 RenderViewContextMenuWin(TabContents* tab_contents, |
| 18 const ContextMenuParams& params); | 18 const ContextMenuParams& params); |
| 19 | 19 |
| 20 ~RenderViewContextMenuWin(); | 20 virtual ~RenderViewContextMenuWin(); |
| 21 | 21 |
| 22 void RunMenuAt(int x, int y); | 22 void RunMenuAt(int x, int y); |
| 23 | 23 |
| 24 // Overridden from SimpleMenuModel::Delegate: | 24 // Overridden from SimpleMenuModel::Delegate: |
| 25 virtual bool IsCommandIdChecked(int command_id) const; | 25 virtual bool IsCommandIdChecked(int command_id) const; |
| 26 virtual bool IsCommandIdEnabled(int command_id) const; | 26 virtual bool IsCommandIdEnabled(int command_id) const; |
| 27 virtual bool GetAcceleratorForCommandId(int command_id, | 27 virtual bool GetAcceleratorForCommandId(int command_id, |
| 28 views::Accelerator* accelerator); | 28 views::Accelerator* accelerator); |
| 29 virtual void ExecuteCommand(int command_id); | 29 virtual void ExecuteCommand(int command_id); |
| 30 | 30 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 55 scoped_ptr<views::SimpleMenuModel> menu_contents_; | 55 scoped_ptr<views::SimpleMenuModel> menu_contents_; |
| 56 scoped_ptr<views::Menu2> menu_; | 56 scoped_ptr<views::Menu2> menu_; |
| 57 // TODO(beng): This way of building submenus is kind of retarded, but it | 57 // TODO(beng): This way of building submenus is kind of retarded, but it |
| 58 // hasn't hurt us yet. It's just a bit awkward. | 58 // hasn't hurt us yet. It's just a bit awkward. |
| 59 views::SimpleMenuModel* sub_menu_contents_; | 59 views::SimpleMenuModel* sub_menu_contents_; |
| 60 // We own submenu models that we create, so we store them here. | 60 // We own submenu models that we create, so we store them here. |
| 61 ScopedVector<views::SimpleMenuModel> submenu_models_; | 61 ScopedVector<views::SimpleMenuModel> submenu_models_; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_WIN_H_ | 64 #endif // CHROME_BROWSER_VIEWS_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_WIN_H_ |
| OLD | NEW |