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 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |