| 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/base_tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
| 9 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" | 9 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" |
| 10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" | 10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 BaseTab* BaseTabStrip::GetTabAt(BaseTab* tab, | 326 BaseTab* BaseTabStrip::GetTabAt(BaseTab* tab, |
| 327 const gfx::Point& tab_in_tab_coordinates) { | 327 const gfx::Point& tab_in_tab_coordinates) { |
| 328 gfx::Point local_point = tab_in_tab_coordinates; | 328 gfx::Point local_point = tab_in_tab_coordinates; |
| 329 ConvertPointToView(tab, this, &local_point); | 329 ConvertPointToView(tab, this, &local_point); |
| 330 views::View* view = GetViewForPoint(local_point); | 330 views::View* view = GetViewForPoint(local_point); |
| 331 if (!view) | 331 if (!view) |
| 332 return NULL; // No tab contains the point. | 332 return NULL; // No tab contains the point. |
| 333 | 333 |
| 334 // Walk up the view hierarchy until we find a tab, or the TabStrip. | 334 // Walk up the view hierarchy until we find a tab, or the TabStrip. |
| 335 while (view && view != this && view->GetID() != VIEW_ID_TAB) | 335 while (view && view != this && view->GetID() != VIEW_ID_TAB) |
| 336 view = view->GetParent(); | 336 view = view->parent(); |
| 337 | 337 |
| 338 return view && view->GetID() == VIEW_ID_TAB ? | 338 return view && view->GetID() == VIEW_ID_TAB ? |
| 339 static_cast<BaseTab*>(view) : NULL; | 339 static_cast<BaseTab*>(view) : NULL; |
| 340 } | 340 } |
| 341 | 341 |
| 342 void BaseTabStrip::Layout() { | 342 void BaseTabStrip::Layout() { |
| 343 // Only do a layout if our size changed. | 343 // Only do a layout if our size changed. |
| 344 if (last_layout_size_ == size()) | 344 if (last_layout_size_ == size()) |
| 345 return; | 345 return; |
| 346 DoLayout(); | 346 DoLayout(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 488 |
| 489 StopAnimating(false); | 489 StopAnimating(false); |
| 490 | 490 |
| 491 GenerateIdealBounds(); | 491 GenerateIdealBounds(); |
| 492 | 492 |
| 493 for (int i = 0; i < tab_count(); ++i) | 493 for (int i = 0; i < tab_count(); ++i) |
| 494 tab_data_[i].tab->SetBoundsRect(tab_data_[i].ideal_bounds); | 494 tab_data_[i].tab->SetBoundsRect(tab_data_[i].ideal_bounds); |
| 495 | 495 |
| 496 SchedulePaint(); | 496 SchedulePaint(); |
| 497 } | 497 } |
| OLD | NEW |