Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1566313002: Remove layout during paint in Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: With sky's changes to fake controller Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698