Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h

Issue 6933037: Multi-tab selection for Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding TabSelectionChanged callback and removing unnecessary method Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 // Controls the context menu of a specific tab. It is created in
24 // TabGtk::OnButtonPressEvent every a time right click occurs on a tab.
James Hawkins 2011/05/18 18:03:10 Don't specify implementation details of interfaces
25 class TabStripMenuController : public ui::SimpleMenuModel::Delegate,
26 public MenuGtk::Delegate {
27 public:
28 // |tab| is the tab for which this menu is created. |model| is the
29 // TabStripModel where this tab belongs to. |index| is the index of |tab|
30 // within the tab strip.
31 TabStripMenuController(TabGtk* tab, TabStripModel* model, int index);
32 virtual ~TabStripMenuController() {}
33 void RunMenu(const gfx::Point& point, guint32 event_time);
34 void Cancel();
35
36 private:
37 // Overridden from ui::SimpleMenuModel::Delegate:
38 virtual bool IsCommandIdChecked(int command_id) const;
39 virtual bool IsCommandIdEnabled(int command_id) const;
40 virtual bool GetAcceleratorForCommandId(int command_id,
41 ui::Accelerator* accelerator);
42 virtual void ExecuteCommand(int command_id);
43
44 // Overridden from MenuGtk::Delegate:
45 GtkWidget* GetImageForCommandId(int command_id) const;
46
47 // The context menu.
48 scoped_ptr<MenuGtk> menu_;
49
50 // Weak pointer to the tab for which the context menu was brought up for. Set
51 // to NULL when the menu is canceled.
52 TabGtk* tab_;
53
54 // The model.
55 TabMenuModel model_;
56
57 DISALLOW_COPY_AND_ASSIGN(TabStripMenuController);
58 };
59
60 #endif // CHROME_BROWSER_UI_GTK_TABS_TAB_STRIP_MENU_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698