OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_GTK_TABS_TAB_STRIP_MENU_CONTROLLER_H_ | |
6 #define CHROME_BROWSER_UI_GTK_TABS_TAB_STRIP_MENU_CONTROLLER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "chrome/browser/ui/gtk/menu_gtk.h" | |
10 #include "chrome/browser/ui/tabs/tab_menu_model.h" | |
11 | |
12 class TabGtk; | |
13 class TabStripModel; | |
14 | |
15 namespace gfx { | |
16 class Point; | |
17 } | |
18 | |
19 namespace ui { | |
20 class Accelerator; | |
21 } | |
22 | |
23 class TabStripMenuController : public ui::SimpleMenuModel::Delegate, | |
James Hawkins
2011/05/12 00:53:54
Document the class.
dpapad
2011/05/12 16:37:08
Done.
| |
24 public MenuGtk::Delegate { | |
25 public: | |
26 TabStripMenuController(TabGtk* tab, TabStripModel* model, int index); | |
James Hawkins
2011/05/12 00:53:54
Document the parameters.
dpapad
2011/05/12 16:37:08
Done.
| |
27 virtual ~TabStripMenuController() {} | |
28 void RunMenu(const gfx::Point& point, guint32 event_time); | |
29 void Cancel(); | |
30 | |
31 private: | |
32 // Overridden from ui::SimpleMenuModel::Delegate: | |
33 virtual bool IsCommandIdChecked(int command_id) const; | |
34 virtual bool IsCommandIdEnabled(int command_id) const; | |
35 virtual bool GetAcceleratorForCommandId(int command_id, | |
36 ui::Accelerator* accelerator); | |
37 virtual void ExecuteCommand(int command_id); | |
38 | |
39 GtkWidget* GetImageForCommandId(int command_id) const; | |
James Hawkins
2011/05/12 00:53:54
// Overridden from ...
dpapad
2011/05/12 16:37:08
Done.
| |
40 | |
41 // The context menu. | |
42 scoped_ptr<MenuGtk> menu_; | |
43 | |
44 // The Tab the context menu was brought up for. Set to NULL when the menu | |
45 // is canceled. | |
46 TabGtk* tab_; | |
James Hawkins
2011/05/12 00:53:54
Document ownership.
dpapad
2011/05/12 16:37:08
No ownership comment implies that it is not owned
James Hawkins
2011/05/12 16:49:48
No. "Absence of evidence..." The correct documenta
dpapad
2011/05/12 17:21:49
Done.
| |
47 | |
48 // The model. | |
49 TabMenuModel model_; | |
50 | |
51 DISALLOW_COPY_AND_ASSIGN(TabStripMenuController); | |
52 }; | |
53 | |
54 #endif // CHROME_BROWSER_UI_GTK_TABS_TAB_STRIP_MENU_CONTROLLER_H_ | |
OLD | NEW |