| 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_strip.h" | 5 #include "chrome/browser/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #include "base/gfx/size.h" | 7 #include "base/gfx/size.h" |
| 8 #include "chrome/app/theme/theme_resources.h" | 8 #include "chrome/app/theme/theme_resources.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/browser/tab_contents.h" | 10 #include "chrome/browser/tab_contents.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 void TabStrip::ContinueDrag(const views::MouseEvent& event) { | 1017 void TabStrip::ContinueDrag(const views::MouseEvent& event) { |
| 1018 // We can get called even if |MaybeStartDrag| wasn't called in the event of | 1018 // We can get called even if |MaybeStartDrag| wasn't called in the event of |
| 1019 // a TabStrip animation when the mouse button is down. In this case we should | 1019 // a TabStrip animation when the mouse button is down. In this case we should |
| 1020 // _not_ continue the drag because it can lead to weird bugs. | 1020 // _not_ continue the drag because it can lead to weird bugs. |
| 1021 if (drag_controller_.get()) | 1021 if (drag_controller_.get()) |
| 1022 drag_controller_->Drag(); | 1022 drag_controller_->Drag(); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 void TabStrip::EndDrag(bool canceled) { | 1025 bool TabStrip::EndDrag(bool canceled) { |
| 1026 if (drag_controller_.get()) | 1026 return drag_controller_.get() ? drag_controller_->EndDrag(canceled) : false; |
| 1027 drag_controller_->EndDrag(canceled); | |
| 1028 } | 1027 } |
| 1029 | 1028 |
| 1030 /////////////////////////////////////////////////////////////////////////////// | 1029 /////////////////////////////////////////////////////////////////////////////// |
| 1031 // TabStrip, views::BaseButton::ButtonListener implementation: | 1030 // TabStrip, views::BaseButton::ButtonListener implementation: |
| 1032 | 1031 |
| 1033 void TabStrip::ButtonPressed(views::BaseButton* sender) { | 1032 void TabStrip::ButtonPressed(views::BaseButton* sender) { |
| 1034 if (sender == newtab_button_) | 1033 if (sender == newtab_button_) |
| 1035 model_->AddBlankTab(true); | 1034 model_->AddBlankTab(true); |
| 1036 } | 1035 } |
| 1037 | 1036 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 return last_tab->x() + last_tab->width(); | 1532 return last_tab->x() + last_tab->width(); |
| 1534 } | 1533 } |
| 1535 | 1534 |
| 1536 bool TabStrip::IsPointInTab(Tab* tab, | 1535 bool TabStrip::IsPointInTab(Tab* tab, |
| 1537 const gfx::Point& point_in_tabstrip_coords) { | 1536 const gfx::Point& point_in_tabstrip_coords) { |
| 1538 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1537 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
| 1539 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1538 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
| 1540 return tab->HitTest(point_in_tab_coords); | 1539 return tab->HitTest(point_in_tab_coords); |
| 1541 } | 1540 } |
| 1542 | 1541 |
| OLD | NEW |