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

Unified 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: Fixing nits 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h
diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h b/chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..cd41781e20847a86de332fea0d0b93fd537f8f35
--- /dev/null
+++ b/chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_GTK_TABS_TAB_STRIP_MENU_CONTROLLER_H_
+#define CHROME_BROWSER_UI_GTK_TABS_TAB_STRIP_MENU_CONTROLLER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/gtk/menu_gtk.h"
+#include "chrome/browser/ui/tabs/tab_menu_model.h"
+
+class TabGtk;
+class TabStripModel;
+
+namespace gfx {
+class Point;
+}
+
+namespace ui {
+class Accelerator;
+}
+
+// Controls the context menu of a specific tab. It is created every time a right
+// click occurs on a tab.
+class TabStripMenuController : public ui::SimpleMenuModel::Delegate,
+ public MenuGtk::Delegate {
+ public:
+ // |tab| is the tab for which this menu is created. |model| is the
+ // TabStripModel where this tab belongs to. |index| is the index of |tab|
+ // within the tab strip.
+ TabStripMenuController(TabGtk* tab, TabStripModel* model, int index);
+ virtual ~TabStripMenuController() {}
+ void RunMenu(const gfx::Point& point, guint32 event_time);
+ void Cancel();
+
+ private:
+ // Overridden from ui::SimpleMenuModel::Delegate:
+ virtual bool IsCommandIdChecked(int command_id) const;
+ virtual bool IsCommandIdEnabled(int command_id) const;
+ virtual bool GetAcceleratorForCommandId(int command_id,
+ ui::Accelerator* accelerator);
+ virtual void ExecuteCommand(int command_id);
+
+ // Overridden from MenuGtk::Delegate:
+ GtkWidget* GetImageForCommandId(int command_id) const;
+
+ // The context menu.
+ scoped_ptr<MenuGtk> menu_;
+
+ // Weak pointer to the tab for which the context menu was brought up for. Set
+ // to NULL when the menu is canceled.
+ TabGtk* tab_;
+
+ // The model.
+ TabMenuModel model_;
+
+ DISALLOW_COPY_AND_ASSIGN(TabStripMenuController);
+};
+
+#endif // CHROME_BROWSER_UI_GTK_TABS_TAB_STRIP_MENU_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698