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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 10821002: Makes the min window size include the OTR image and caption buttons on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/popup_non_client_frame_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 1bdccf84ddb350dfa1cb8f52e3c77e78915d7fb1..d1454a39227c410f886ec89aa2fc01d68cfaac6a 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1233,12 +1233,19 @@ std::string TabStrip::GetClassName() const {
}
gfx::Size TabStrip::GetPreferredSize() {
- // Report the minimum width as the size required for a single selected tab
- // plus the new tab button. Don't base it on the actual number of tabs because
- // it's undesirable to have the minimum window size change when a new tab is
- // opened.
- int needed_width = Tab::GetMinimumSelectedSize().width() -
- tab_h_offset() + new_tab_button_width();
+ // For stacked tabs the minimum size is calculated as the size needed to
+ // handle showing any number of tabs. Otherwise report the minimum width as
+ // the size required for a single selected tab plus the new tab button. Don't
+ // base it on the actual number of tabs because it's undesirable to have the
+ // minimum window size change when a new tab is opened.
+ int needed_width;
+ if (touch_layout_.get() || adjust_layout_) {
+ needed_width = Tab::GetTouchWidth() +
+ (2 * kStackedPadding * kMaxStackedCount);
+ } else {
+ needed_width = Tab::GetMinimumSelectedSize().width();
+ }
+ needed_width += new_tab_button_width();
return gfx::Size(needed_width, Tab::GetMinimumUnselectedSize().height());
}
@@ -2341,7 +2348,7 @@ bool TabStrip::NeedsTouchLayout() const {
int mini_tab_count = GetMiniTabCount();
int normal_count = tab_count() - mini_tab_count;
- if (normal_count == 0 || normal_count == mini_tab_count)
+ if (normal_count <= 1 || normal_count == mini_tab_count)
return false;
int x = GetStartXForNormalTabs();
int available_width = width() - x - new_tab_button_width();
« no previous file with comments | « chrome/browser/ui/views/frame/popup_non_client_frame_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698