OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/gtk/tabs/tab_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_gtk.h" |
6 | 6 |
7 #include "chrome/browser/gtk/menu_gtk.h" | 7 #include "chrome/browser/gtk/menu_gtk.h" |
8 #include "chrome/common/gfx/path.h" | 8 #include "chrome/common/gfx/path.h" |
9 #include "chrome/common/l10n_util.h" | 9 #include "chrome/common/l10n_util.h" |
10 #include "chrome/common/resource_bundle.h" | 10 #include "chrome/common/resource_bundle.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 bool TabGtk::OnMousePress(const gfx::Point& point) { | 139 bool TabGtk::OnMousePress(const gfx::Point& point) { |
140 if (close_button_.get()->IsPointInBounds(point)) | 140 if (close_button_.get()->IsPointInBounds(point)) |
141 return close_button_.get()->OnMousePress(); | 141 return close_button_.get()->OnMousePress(); |
142 | 142 |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
146 void TabGtk::OnMouseRelease(GdkEventButton* event) { | 146 void TabGtk::OnMouseRelease(GdkEventButton* event) { |
147 close_button_.get()->OnMouseRelease(); | 147 close_button_.get()->OnMouseRelease(); |
148 | 148 |
149 if (event->button == 3) { | 149 if (event->button == 2) { |
| 150 delegate_->CloseTab(this); |
| 151 } else if (event->button == 3) { |
150 ShowContextMenu(); | 152 ShowContextMenu(); |
151 } | 153 } |
152 } | 154 } |
153 | 155 |
154 bool TabGtk::OnLeaveNotify() { | 156 bool TabGtk::OnLeaveNotify() { |
155 bool paint = set_hovering(false); | 157 bool paint = set_hovering(false); |
156 paint |= close_button_.get()->OnLeaveNotify(); | 158 paint |= close_button_.get()->OnLeaveNotify(); |
157 return paint; | 159 return paint; |
158 } | 160 } |
159 | 161 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 if (!menu_controller_.get()) | 217 if (!menu_controller_.get()) |
216 menu_controller_.reset(new ContextMenuController(this)); | 218 menu_controller_.reset(new ContextMenuController(this)); |
217 | 219 |
218 menu_controller_->RunMenu(); | 220 menu_controller_->RunMenu(); |
219 } | 221 } |
220 | 222 |
221 void TabGtk::ContextMenuClosed() { | 223 void TabGtk::ContextMenuClosed() { |
222 delegate()->StopAllHighlighting(); | 224 delegate()->StopAllHighlighting(); |
223 menu_controller_.reset(); | 225 menu_controller_.reset(); |
224 } | 226 } |
OLD | NEW |