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

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

Issue 893843007: Experiment to hide close buttons of inactive tabs when using touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added flag to histograms.xml Created 5 years, 10 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/about_flags.cc ('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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 } 1437 }
1438 1438
1439 bool Tab::ShouldShowMediaIndicator() const { 1439 bool Tab::ShouldShowMediaIndicator() const {
1440 return chrome::ShouldTabShowMediaIndicator( 1440 return chrome::ShouldTabShowMediaIndicator(
1441 IconCapacity(), data().mini, IsActive(), data().show_icon, 1441 IconCapacity(), data().mini, IsActive(), data().show_icon,
1442 media_indicator_button_ ? media_indicator_button_->showing_media_state() : 1442 media_indicator_button_ ? media_indicator_button_->showing_media_state() :
1443 data_.media_state); 1443 data_.media_state);
1444 } 1444 }
1445 1445
1446 bool Tab::ShouldShowCloseBox() const { 1446 bool Tab::ShouldShowCloseBox() const {
1447 if (!IsActive() && controller_->ShouldHideCloseButtonForInactiveTab(this))
1448 return false;
1449
1447 return chrome::ShouldTabShowCloseButton( 1450 return chrome::ShouldTabShowCloseButton(
1448 IconCapacity(), data().mini, IsActive()); 1451 IconCapacity(), data().mini, IsActive());
1449 } 1452 }
1450 1453
1451 double Tab::GetThrobValue() { 1454 double Tab::GetThrobValue() {
1452 const bool is_selected = IsSelected(); 1455 const bool is_selected = IsSelected();
1453 const double min = is_selected ? kSelectedTabOpacity : 0; 1456 const double min = is_selected ? kSelectedTabOpacity : 0;
1454 const double scale = is_selected ? kSelectedTabThrobScale : 1; 1457 const double scale = is_selected ? kSelectedTabThrobScale : 1;
1455 1458
1456 // Showing both the pulse and title change animation at the same time is too 1459 // Showing both the pulse and title change animation at the same time is too
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 const gfx::ImageSkia& image) { 1602 const gfx::ImageSkia& image) {
1600 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); 1603 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE);
1601 ImageCacheEntry entry; 1604 ImageCacheEntry entry;
1602 entry.resource_id = resource_id; 1605 entry.resource_id = resource_id;
1603 entry.scale_factor = scale_factor; 1606 entry.scale_factor = scale_factor;
1604 entry.image = image; 1607 entry.image = image;
1605 image_cache_->push_front(entry); 1608 image_cache_->push_front(entry);
1606 if (image_cache_->size() > kMaxImageCacheSize) 1609 if (image_cache_->size() > kMaxImageCacheSize)
1607 image_cache_->pop_back(); 1610 image_cache_->pop_back();
1608 } 1611 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/views/tabs/tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698