| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // the width of a pinned tab is at least kPinnedTabExtraWidthToRenderAsNormal | 74 // the width of a pinned tab is at least kPinnedTabExtraWidthToRenderAsNormal |
| 75 // larger than the desired pinned tab width then the tab is rendered as a normal | 75 // larger than the desired pinned tab width then the tab is rendered as a normal |
| 76 // tab. This is done to avoid having the title immediately disappear when | 76 // tab. This is done to avoid having the title immediately disappear when |
| 77 // transitioning a tab from normal to pinned tab. | 77 // transitioning a tab from normal to pinned tab. |
| 78 const int kPinnedTabExtraWidthToRenderAsNormal = 30; | 78 const int kPinnedTabExtraWidthToRenderAsNormal = 30; |
| 79 | 79 |
| 80 // How opaque to make the hover state (out of 1). | 80 // How opaque to make the hover state (out of 1). |
| 81 const double kHoverOpacity = 0.33; | 81 const double kHoverOpacity = 0.33; |
| 82 | 82 |
| 83 // Opacity of the active tab background painted over inactive selected tabs. | 83 // Opacity of the active tab background painted over inactive selected tabs. |
| 84 const double kSelectedTabOpacity = 0.45; | 84 const double kSelectedTabOpacity = 0.3; |
| 85 | 85 |
| 86 // Inactive selected tabs have their throb value scaled by this. | 86 // Inactive selected tabs have their throb value scaled by this. |
| 87 const double kSelectedTabThrobScale = 0.95 - kSelectedTabOpacity; | 87 const double kSelectedTabThrobScale = 0.95 - kSelectedTabOpacity; |
| 88 | 88 |
| 89 // Durations for the various parts of the pinned tab title animation. | 89 // Durations for the various parts of the pinned tab title animation. |
| 90 const int kPinnedTitleChangeAnimationDuration1MS = 1600; | 90 const int kPinnedTitleChangeAnimationDuration1MS = 1600; |
| 91 const int kPinnedTitleChangeAnimationStart1MS = 0; | 91 const int kPinnedTitleChangeAnimationStart1MS = 0; |
| 92 const int kPinnedTitleChangeAnimationEnd1MS = 1900; | 92 const int kPinnedTitleChangeAnimationEnd1MS = 1900; |
| 93 const int kPinnedTitleChangeAnimationDuration2MS = 0; | 93 const int kPinnedTitleChangeAnimationDuration2MS = 0; |
| 94 const int kPinnedTitleChangeAnimationDuration3MS = 550; | 94 const int kPinnedTitleChangeAnimationDuration3MS = 550; |
| (...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 const gfx::ImageSkia& image) { | 1613 const gfx::ImageSkia& image) { |
| 1614 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1614 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
| 1615 ImageCacheEntry entry; | 1615 ImageCacheEntry entry; |
| 1616 entry.resource_id = resource_id; | 1616 entry.resource_id = resource_id; |
| 1617 entry.scale_factor = scale_factor; | 1617 entry.scale_factor = scale_factor; |
| 1618 entry.image = image; | 1618 entry.image = image; |
| 1619 image_cache_->push_front(entry); | 1619 image_cache_->push_front(entry); |
| 1620 if (image_cache_->size() > kMaxImageCacheSize) | 1620 if (image_cache_->size() > kMaxImageCacheSize) |
| 1621 image_cache_->pop_back(); | 1621 image_cache_->pop_back(); |
| 1622 } | 1622 } |
| OLD | NEW |