Index: chrome/browser/ui/gtk/tabs/tab_gtk.cc |
diff --git a/chrome/browser/ui/gtk/tabs/tab_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_gtk.cc |
index d5cdd31a593c45546320cedbed407218c3d7c2ef..9dbd7df4cd789a1636089403af91164d8f938798 100644 |
--- a/chrome/browser/ui/gtk/tabs/tab_gtk.cc |
+++ b/chrome/browser/ui/gtk/tabs/tab_gtk.cc |
@@ -36,7 +36,8 @@ class TabGtk::ContextMenuController : public ui::SimpleMenuModel::Delegate, |
public: |
explicit ContextMenuController(TabGtk* tab) |
: tab_(tab), |
- model_(this, tab->delegate()->IsTabPinned(tab)) { |
+ model_(this, tab->delegate()->model(), |
+ tab->delegate()->GetIndexOfTab(const_cast<const TabGtk*>(tab))) { |
dpapad
2011/05/10 16:28:14
This is the hacky part. In order to invoke the des
|
menu_.reset(new MenuGtk(this, &model_)); |
} |
@@ -176,11 +177,16 @@ gboolean TabGtk::OnButtonPressEvent(GtkWidget* widget, GdkEventButton* event) { |
// Store whether or not we were selected just now... we only want to be |
// able to drag foreground tabs, so we don't start dragging the tab if |
// it was in the background. |
- bool just_selected = !IsSelected(); |
- if (just_selected) { |
- delegate_->SelectTab(this); |
+ if (!IsActive() && (event->state & 5) == 0) { |
+ delegate_->ActivateTab(this); |
+ } else if (!IsActive() && (event->state & 4) == 4) { |
+ // TODO(dpapad) |
+ NOTIMPLEMENTED() << " Multi tab selection ctrl click under construction"; |
+ delegate_->ToggleTabSelection(this); |
+ } else if (!IsActive() && (event->state & 1) == 1) { |
+ NOTIMPLEMENTED() << " Multi tab selection shift click under construction"; |
+ delegate_->ExtendTabSelection(this); |
} |
- |
// Hook into the message loop to handle dragging. |
observer_.reset(new TabGtkObserverHelper(this)); |
@@ -293,6 +299,10 @@ void TabGtk::DidProcessEvent(GdkEvent* event) { |
/////////////////////////////////////////////////////////////////////////////// |
// TabGtk, TabRendererGtk overrides: |
+bool TabGtk::IsActive() const { |
+ return delegate_->IsTabActive(this); |
+} |
+ |
bool TabGtk::IsSelected() const { |
return delegate_->IsTabSelected(this); |
} |