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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.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: histograms.xml changed 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.h ('k') | chrome/browser/ui/views/tabs/tab_controller.h » ('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.h" 5 #include "chrome/browser/ui/views/tabs/tab.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 } 1454 }
1455 1455
1456 bool Tab::ShouldShowMediaIndicator() const { 1456 bool Tab::ShouldShowMediaIndicator() const {
1457 return chrome::ShouldTabShowMediaIndicator( 1457 return chrome::ShouldTabShowMediaIndicator(
1458 IconCapacity(), data().mini, IsActive(), data().show_icon, 1458 IconCapacity(), data().mini, IsActive(), data().show_icon,
1459 media_indicator_button_ ? media_indicator_button_->showing_media_state() : 1459 media_indicator_button_ ? media_indicator_button_->showing_media_state() :
1460 data_.media_state); 1460 data_.media_state);
1461 } 1461 }
1462 1462
1463 bool Tab::ShouldShowCloseBox() const { 1463 bool Tab::ShouldShowCloseBox() const {
1464 if (!IsActive() && controller_->ShouldHideCloseButtonForInactiveTab(this)) 1464 if (!IsActive() && controller_->ShouldHideCloseButtonForInactiveTabs())
1465 return false; 1465 return false;
1466 1466
1467 return chrome::ShouldTabShowCloseButton( 1467 return chrome::ShouldTabShowCloseButton(
1468 IconCapacity(), data().mini, IsActive()); 1468 IconCapacity(), data().mini, IsActive());
1469 } 1469 }
1470 1470
1471 double Tab::GetThrobValue() { 1471 double Tab::GetThrobValue() {
1472 const bool is_selected = IsSelected(); 1472 const bool is_selected = IsSelected();
1473 const double min = is_selected ? kSelectedTabOpacity : 0; 1473 const double min = is_selected ? kSelectedTabOpacity : 0;
1474 const double scale = is_selected ? kSelectedTabThrobScale : 1; 1474 const double scale = is_selected ? kSelectedTabThrobScale : 1;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 const gfx::ImageSkia& image) { 1619 const gfx::ImageSkia& image) {
1620 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); 1620 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE);
1621 ImageCacheEntry entry; 1621 ImageCacheEntry entry;
1622 entry.resource_id = resource_id; 1622 entry.resource_id = resource_id;
1623 entry.scale_factor = scale_factor; 1623 entry.scale_factor = scale_factor;
1624 entry.image = image; 1624 entry.image = image;
1625 image_cache_->push_front(entry); 1625 image_cache_->push_front(entry);
1626 if (image_cache_->size() > kMaxImageCacheSize) 1626 if (image_cache_->size() > kMaxImageCacheSize)
1627 image_cache_->pop_back(); 1627 image_cache_->pop_back();
1628 } 1628 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.h ('k') | chrome/browser/ui/views/tabs/tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698