| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 // Paint the New Tab button. | 304 // Paint the New Tab button. |
| 305 newtab_button_->ProcessPaint(canvas); | 305 newtab_button_->ProcessPaint(canvas); |
| 306 | 306 |
| 307 // And the dragged tab. | 307 // And the dragged tab. |
| 308 if (dragging_tab) | 308 if (dragging_tab) |
| 309 dragging_tab->ProcessPaint(canvas); | 309 dragging_tab->ProcessPaint(canvas); |
| 310 } | 310 } |
| 311 | 311 |
| 312 // Overridden to support automation. See automation_proxy_uitest.cc. | 312 // Overridden to support automation. See automation_proxy_uitest.cc. |
| 313 views::View* TabStrip::GetViewByID(int view_id) const { | 313 const views::View* TabStrip::GetViewByID(int view_id) const { |
| 314 if (tab_count() > 0) { | 314 if (tab_count() > 0) { |
| 315 if (view_id == VIEW_ID_TAB_LAST) { | 315 if (view_id == VIEW_ID_TAB_LAST) { |
| 316 return GetTabAtTabDataIndex(tab_count() - 1); | 316 return GetTabAtTabDataIndex(tab_count() - 1); |
| 317 } else if ((view_id >= VIEW_ID_TAB_0) && (view_id < VIEW_ID_TAB_LAST)) { | 317 } else if ((view_id >= VIEW_ID_TAB_0) && (view_id < VIEW_ID_TAB_LAST)) { |
| 318 int index = view_id - VIEW_ID_TAB_0; | 318 int index = view_id - VIEW_ID_TAB_0; |
| 319 if (index >= 0 && index < tab_count()) { | 319 if (index >= 0 && index < tab_count()) { |
| 320 return GetTabAtTabDataIndex(index); | 320 return GetTabAtTabDataIndex(index); |
| 321 } else { | 321 } else { |
| 322 return NULL; | 322 return NULL; |
| 323 } | 323 } |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { | 949 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { |
| 950 return last_tab->x() + last_tab->width(); | 950 return last_tab->x() + last_tab->width(); |
| 951 } | 951 } |
| 952 | 952 |
| 953 bool TabStrip::IsPointInTab(Tab* tab, | 953 bool TabStrip::IsPointInTab(Tab* tab, |
| 954 const gfx::Point& point_in_tabstrip_coords) { | 954 const gfx::Point& point_in_tabstrip_coords) { |
| 955 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 955 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
| 956 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 956 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
| 957 return tab->HitTest(point_in_tab_coords); | 957 return tab->HitTest(point_in_tab_coords); |
| 958 } | 958 } |
| OLD | NEW |