| Index: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
|
| ===================================================================
|
| --- chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc (revision 141203)
|
| +++ chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc (working copy)
|
| @@ -27,6 +27,7 @@
|
| #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h"
|
| #include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h"
|
| #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
|
| +#include "chrome/browser/ui/tabs/recently_closed_tabs_menu_model.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| #include "content/public/browser/notification_source.h"
|
| #include "content/public/browser/web_contents.h"
|
| @@ -2170,6 +2171,22 @@
|
| return TRUE;
|
| }
|
|
|
| +void TabStripGtk::ShowRecentlyClosedTabsMenu(GtkWidget* widget,
|
| + int button, guint32 event_time) {
|
| + Browser* browser = window_->browser();
|
| + DCHECK(browser);
|
| + menu_model_.reset(new RecentlyClosedTabsMenuModel(browser));
|
| + menu_.reset(new MenuGtk(this, menu_model_.get()));
|
| + menu_->PopupForWidget(widget, button, event_time);
|
| +}
|
| +
|
| +gboolean TabStripGtk::OnButtonPress(GtkWidget* widget,
|
| + GdkEventButton* event) {
|
| + if (event->button == 3)
|
| + ShowRecentlyClosedTabsMenu(widget, event->button, event->time);
|
| + return FALSE;
|
| +}
|
| +
|
| void TabStripGtk::OnNewTabClicked(GtkWidget* widget) {
|
| GdkEvent* event = gtk_get_current_event();
|
| DCHECK_EQ(event->type, GDK_BUTTON_RELEASE);
|
| @@ -2245,6 +2262,9 @@
|
| gtk_widget_set_tooltip_text(button->widget(),
|
| l10n_util::GetStringUTF8(IDS_TOOLTIP_NEW_TAB).c_str());
|
|
|
| + g_signal_connect(button->widget(), "button-press-event",
|
| + G_CALLBACK(OnButtonPressThunk), this);
|
| +
|
| // Let the middle mouse button initiate clicks as well.
|
| gtk_util::SetButtonTriggersNavigation(button->widget());
|
| g_signal_connect(button->widget(), "clicked",
|
| @@ -2263,3 +2283,7 @@
|
| SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK);
|
| newtab_button_->SetBackground(color, background, mask);
|
| }
|
| +
|
| +bool TabStripGtk::AlwaysShowIconForCmd(int command_id) const {
|
| + return true;
|
| +}
|
|
|