OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |