| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 } | 722 } |
| 723 stacked_layout_ = stacked_layout; | 723 stacked_layout_ = stacked_layout; |
| 724 SetResetToShrinkOnExit(false); | 724 SetResetToShrinkOnExit(false); |
| 725 SwapLayoutIfNecessary(); | 725 SwapLayoutIfNecessary(); |
| 726 // When transitioning to stacked try to keep the active tab centered. | 726 // When transitioning to stacked try to keep the active tab centered. |
| 727 if (touch_layout_ && active_index != -1) { | 727 if (touch_layout_ && active_index != -1) { |
| 728 touch_layout_->SetActiveTabLocation( | 728 touch_layout_->SetActiveTabLocation( |
| 729 active_center - ideal_bounds(active_index).width() / 2); | 729 active_center - ideal_bounds(active_index).width() / 2); |
| 730 AnimateToIdealBounds(); | 730 AnimateToIdealBounds(); |
| 731 } | 731 } |
| 732 |
| 733 for (int i = 0; i < tab_count(); ++i) |
| 734 tab_at(i)->HideCloseButtonForInactiveTabsChanged(); |
| 732 } | 735 } |
| 733 | 736 |
| 734 gfx::Rect TabStrip::GetNewTabButtonBounds() { | 737 gfx::Rect TabStrip::GetNewTabButtonBounds() { |
| 735 return newtab_button_->bounds(); | 738 return newtab_button_->bounds(); |
| 736 } | 739 } |
| 737 | 740 |
| 738 bool TabStrip::SizeTabButtonToTopOfTabStrip() { | 741 bool TabStrip::SizeTabButtonToTopOfTabStrip() { |
| 739 // Extend the button to the screen edge in maximized and immersive fullscreen. | 742 // Extend the button to the screen edge in maximized and immersive fullscreen. |
| 740 views::Widget* widget = GetWidget(); | 743 views::Widget* widget = GetWidget(); |
| 741 return browser_defaults::kSizeTabButtonToTopOfTabStrip || | 744 return browser_defaults::kSizeTabButtonToTopOfTabStrip || |
| (...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2860 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2863 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
| 2861 if (view) | 2864 if (view) |
| 2862 return view; | 2865 return view; |
| 2863 } | 2866 } |
| 2864 Tab* tab = FindTabForEvent(point); | 2867 Tab* tab = FindTabForEvent(point); |
| 2865 if (tab) | 2868 if (tab) |
| 2866 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2869 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
| 2867 } | 2870 } |
| 2868 return this; | 2871 return this; |
| 2869 } | 2872 } |
| OLD | NEW |