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/views/tabs/tab.h" | 5 #include "chrome/browser/views/tabs/tab.h" |
6 | 6 |
7 #include "base/gfx/size.h" | 7 #include "base/gfx/size.h" |
8 #include "chrome/common/gfx/chrome_canvas.h" | 8 #include "chrome/common/gfx/chrome_canvas.h" |
9 #include "chrome/common/gfx/path.h" | 9 #include "chrome/common/gfx/path.h" |
10 #include "chrome/common/l10n_util.h" | 10 #include "chrome/common/l10n_util.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 bool Tab::HasHitTestMask() const { | 156 bool Tab::HasHitTestMask() const { |
157 return true; | 157 return true; |
158 } | 158 } |
159 | 159 |
160 void Tab::GetHitTestMask(gfx::Path* mask) const { | 160 void Tab::GetHitTestMask(gfx::Path* mask) const { |
161 MakePathForTab(mask); | 161 MakePathForTab(mask); |
162 } | 162 } |
163 | 163 |
164 bool Tab::OnMousePressed(const views::MouseEvent& event) { | 164 bool Tab::OnMousePressed(const views::MouseEvent& event) { |
165 if (event.IsLeftMouseButton()) { | 165 if (event.IsOnlyLeftMouseButton()) { |
166 // Store whether or not we were selected just now... we only want to be | 166 // Store whether or not we were selected just now... we only want to be |
167 // able to drag foreground tabs, so we don't start dragging the tab if | 167 // able to drag foreground tabs, so we don't start dragging the tab if |
168 // it was in the background. | 168 // it was in the background. |
169 bool just_selected = !IsSelected(); | 169 bool just_selected = !IsSelected(); |
170 if (just_selected) | 170 if (just_selected) |
171 delegate_->SelectTab(this); | 171 delegate_->SelectTab(this); |
172 delegate_->MaybeStartDrag(this, event); | 172 delegate_->MaybeStartDrag(this, event); |
173 } | 173 } |
174 return true; | 174 return true; |
175 } | 175 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 // Close out the path. | 274 // Close out the path. |
275 path->lineTo(0, h); | 275 path->lineTo(0, h); |
276 path->close(); | 276 path->close(); |
277 } | 277 } |
278 | 278 |
279 void Tab::ContextMenuClosed() { | 279 void Tab::ContextMenuClosed() { |
280 delegate()->StopAllHighlighting(); | 280 delegate()->StopAllHighlighting(); |
281 menu_controller_ = NULL; | 281 menu_controller_ = NULL; |
282 } | 282 } |
OLD | NEW |