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

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 22353017: Fix the "throb" animation for the immersive fullscreen light bars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index f556be58f45d6f0c681d8fde274a76a935e214fa..fde98892ecf4e44523e02ef81c9d4da247d205dc 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -238,6 +238,10 @@ const int kImmersiveBarHeight = 2;
const SkColor kImmersiveActiveTabColor = SkColorSetRGB(235, 235, 235);
const SkColor kImmersiveInactiveTabColor = SkColorSetRGB(190, 190, 190);
+// The minimum opacity (out of 1) when a tab (either active or inactive) is
+// throbbing in the immersive mode light strip.
+const double kImmersiveTabMinThrobOpacity = 0.66;
+
// Number of steps in the immersive mode loading animation.
const int kImmersiveLoadingStepCount = 32;
@@ -1115,9 +1119,13 @@ void Tab::PaintTab(gfx::Canvas* canvas) {
void Tab::PaintImmersiveTab(gfx::Canvas* canvas) {
// Use transparency for the draw-attention animation.
- int alpha = (tab_animation_ && tab_animation_->is_animating())
- ? static_cast<int>(GetThrobValue() * 255)
- : 255;
+ int alpha = 255;
+ if (tab_animation_ &&
+ tab_animation_->is_animating() &&
+ !data().mini) {
+ alpha = tab_animation_->CurrentValueBetween(
+ 255, static_cast<int>(255 * kImmersiveTabMinThrobOpacity));
+ }
// Draw a gray rectangle to represent the tab. This works for mini-tabs as
// well as regular ones. The active tab has a brigher bar.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698