| Index: chrome/browser/ui/views/tabs/base_tab_strip.cc
|
| diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.cc b/chrome/browser/ui/views/tabs/base_tab_strip.cc
|
| index 48f6d69803a03b202928605dd0374fdba285f1c0..cfd0bc0e36801a4a0b21351753812dbb2b34c0ee 100644
|
| --- a/chrome/browser/ui/views/tabs/base_tab_strip.cc
|
| +++ b/chrome/browser/ui/views/tabs/base_tab_strip.cc
|
| @@ -378,16 +378,7 @@ BaseTab* BaseTabStrip::GetTabAt(BaseTab* tab,
|
| const gfx::Point& tab_in_tab_coordinates) {
|
| gfx::Point local_point = tab_in_tab_coordinates;
|
| ConvertPointToView(tab, this, &local_point);
|
| - views::View* view = GetEventHandlerForPoint(local_point);
|
| - if (!view)
|
| - return NULL; // No tab contains the point.
|
| -
|
| - // Walk up the view hierarchy until we find a tab, or the TabStrip.
|
| - while (view && view != this && view->GetID() != VIEW_ID_TAB)
|
| - view = view->parent();
|
| -
|
| - return view && view->GetID() == VIEW_ID_TAB ?
|
| - static_cast<BaseTab*>(view) : NULL;
|
| + return GetTabAtLocal(local_point);
|
| }
|
|
|
| void BaseTabStrip::Layout() {
|
| @@ -571,6 +562,20 @@ void BaseTabStrip::DoLayout() {
|
| SchedulePaint();
|
| }
|
|
|
| +BaseTab* BaseTabStrip::GetTabAtLocal(
|
| + const gfx::Point& local_point) {
|
| + views::View* view = GetEventHandlerForPoint(local_point);
|
| + if (!view)
|
| + return NULL; // No tab contains the point.
|
| +
|
| + // Walk up the view hierarchy until we find a tab, or the TabStrip.
|
| + while (view && view != this && view->GetID() != VIEW_ID_TAB)
|
| + view = view->parent();
|
| +
|
| + return view && view->GetID() == VIEW_ID_TAB ?
|
| + static_cast<BaseTab*>(view) : NULL;
|
| +}
|
| +
|
| void BaseTabStrip::StoppedDraggingTab(BaseTab* tab, bool* is_first_tab) {
|
| int tab_data_index = TabIndexOfTab(tab);
|
| if (tab_data_index == -1) {
|
|
|