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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 | 151 |
152 bool Tab::HasHitTestMask() const { | 152 bool Tab::HasHitTestMask() const { |
153 return true; | 153 return true; |
154 } | 154 } |
155 | 155 |
156 void Tab::GetHitTestMask(gfx::Path* mask) const { | 156 void Tab::GetHitTestMask(gfx::Path* mask) const { |
157 MakePathForTab(mask); | 157 MakePathForTab(mask); |
158 } | 158 } |
159 | 159 |
160 bool Tab::OnMousePressed(const views::MouseEvent& event) { | 160 bool Tab::OnMousePressed(const views::MouseEvent& event) { |
161 if (event.IsOnlyLeftMouseButton()) { | 161 if (event.IsLeftMouseButton()) { |
162 if (delegate_->ContainsExactlyOneTab()) { | |
163 SendMessage(GetWidget()->GetHWND(), WM_NCLBUTTONDOWN, | |
Peter Kasting
2009/02/18 16:58:25
Nit: Please add a comment explaining what the effe
idanan
2009/02/18 18:02:23
Done.
| |
164 HTCAPTION, MAKELPARAM(event.x(), event.y())); | |
165 return false; | |
166 } | |
162 // Store whether or not we were selected just now... we only want to be | 167 // Store whether or not we were selected just now... we only want to be |
163 // able to drag foreground tabs, so we don't start dragging the tab if | 168 // able to drag foreground tabs, so we don't start dragging the tab if |
164 // it was in the background. | 169 // it was in the background. |
165 bool just_selected = !IsSelected(); | 170 bool just_selected = !IsSelected(); |
166 if (just_selected) | 171 if (just_selected) |
167 delegate_->SelectTab(this); | 172 delegate_->SelectTab(this); |
168 delegate_->MaybeStartDrag(this, event); | 173 delegate_->MaybeStartDrag(this, event); |
169 } | 174 } |
170 return true; | 175 return true; |
171 } | 176 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 | 275 |
271 // Close out the path. | 276 // Close out the path. |
272 path->lineTo(0, h); | 277 path->lineTo(0, h); |
273 path->close(); | 278 path->close(); |
274 } | 279 } |
275 | 280 |
276 void Tab::ContextMenuClosed() { | 281 void Tab::ContextMenuClosed() { |
277 delegate()->StopAllHighlighting(); | 282 delegate()->StopAllHighlighting(); |
278 menu_controller_ = NULL; | 283 menu_controller_ = NULL; |
279 } | 284 } |
OLD | NEW |