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

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

Issue 983853002: Hide close buttons of inactive stacked tabs by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new tests Created 5 years, 9 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
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 cffe4a382cf33dd5dae4ce08be2b7f75e74bd46d..105a1b369e556e1a6cdec29131f59c415b568e7f 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -969,28 +969,17 @@ bool TabStrip::SupportsMultipleSelection() {
return touch_layout_ == NULL;
}
-// TODO(tdanderson): Modify this logic and clean up related code once a
-// decision has been made on the experimental
-// flag --tab-close-buttons-hidden-with-touch.
bool TabStrip::ShouldHideCloseButtonForInactiveTab(const Tab* tab) {
DCHECK(!tab->IsActive());
// Do not force the close button to hide if mouse was used as
- // the last input type to interact with the tab strip.
- if (!stacked_layout_)
+ // the last input type to interact with the tab strip or if
+ // the tabs are wider than the width used for stacked tabs.
+ if (!stacked_layout_ || tab->width() > Tab::GetTouchWidth())
sky 2015/03/06 23:28:33 Don't you just care about if touch_layout_ is non-
tdanderson 2015/03/09 17:30:53 Yes, you're right - I can just do that instead sin
return false;
- std::string switch_value =
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kTabCloseButtonsHiddenWithTouch);
- int width = tab->width();
- if (switch_value == "always" ||
- (switch_value == "narrow" && width < Tab::GetStandardSize().width()) ||
- (switch_value == "stacked" && width <= Tab::GetTouchWidth())) {
- return true;
- }
-
- return false;
+ return !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableHideInactiveStackedTabCloseButtons);
}
void TabStrip::SelectTab(Tab* tab) {

Powered by Google App Engine
This is Rietveld 408576698