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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 static const double kSelectedTabThrobScale = .5; | 189 static const double kSelectedTabThrobScale = .5; |
190 | 190 |
191 // Durations for the various parts of the mini tab title animation. | 191 // Durations for the various parts of the mini tab title animation. |
192 static const int kMiniTitleChangeAnimationDuration1MS = 1600; | 192 static const int kMiniTitleChangeAnimationDuration1MS = 1600; |
193 static const int kMiniTitleChangeAnimationStart1MS = 0; | 193 static const int kMiniTitleChangeAnimationStart1MS = 0; |
194 static const int kMiniTitleChangeAnimationEnd1MS = 1900; | 194 static const int kMiniTitleChangeAnimationEnd1MS = 1900; |
195 static const int kMiniTitleChangeAnimationDuration2MS = 0; | 195 static const int kMiniTitleChangeAnimationDuration2MS = 0; |
196 static const int kMiniTitleChangeAnimationDuration3MS = 550; | 196 static const int kMiniTitleChangeAnimationDuration3MS = 550; |
197 static const int kMiniTitleChangeAnimationStart3MS = 150; | 197 static const int kMiniTitleChangeAnimationStart3MS = 150; |
198 static const int kMiniTitleChangeAnimationEnd3MS = 800; | 198 static const int kMiniTitleChangeAnimationEnd3MS = 800; |
199 static const int kMiniTitleChangeAnimationIntervalMS = 40; | |
200 | 199 |
201 // Offset from the right edge for the start of the mini title change animation. | 200 // Offset from the right edge for the start of the mini title change animation. |
202 static const int kMiniTitleChangeInitialXOffset = 6; | 201 static const int kMiniTitleChangeInitialXOffset = 6; |
203 | 202 |
204 // Radius of the radial gradient used for mini title change animation. | 203 // Radius of the radial gradient used for mini title change animation. |
205 static const int kMiniTitleChangeGradientRadius = 20; | 204 static const int kMiniTitleChangeGradientRadius = 20; |
206 | 205 |
207 // Colors of the gradient used during the mini title change animation. | 206 // Colors of the gradient used during the mini title change animation. |
208 static const SkColor kMiniTitleChangeGradientColor1 = SK_ColorWHITE; | 207 static const SkColor kMiniTitleChangeGradientColor1 = SK_ColorWHITE; |
209 static const SkColor kMiniTitleChangeGradientColor2 = | 208 static const SkColor kMiniTitleChangeGradientColor2 = |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 parts.push_back( | 241 parts.push_back( |
243 ui::MultiAnimation::Part(kMiniTitleChangeAnimationDuration2MS, | 242 ui::MultiAnimation::Part(kMiniTitleChangeAnimationDuration2MS, |
244 ui::Tween::ZERO)); | 243 ui::Tween::ZERO)); |
245 parts.push_back( | 244 parts.push_back( |
246 ui::MultiAnimation::Part(kMiniTitleChangeAnimationDuration3MS, | 245 ui::MultiAnimation::Part(kMiniTitleChangeAnimationDuration3MS, |
247 ui::Tween::EASE_IN)); | 246 ui::Tween::EASE_IN)); |
248 parts[0].start_time_ms = kMiniTitleChangeAnimationStart1MS; | 247 parts[0].start_time_ms = kMiniTitleChangeAnimationStart1MS; |
249 parts[0].end_time_ms = kMiniTitleChangeAnimationEnd1MS; | 248 parts[0].end_time_ms = kMiniTitleChangeAnimationEnd1MS; |
250 parts[2].start_time_ms = kMiniTitleChangeAnimationStart3MS; | 249 parts[2].start_time_ms = kMiniTitleChangeAnimationStart3MS; |
251 parts[2].end_time_ms = kMiniTitleChangeAnimationEnd3MS; | 250 parts[2].end_time_ms = kMiniTitleChangeAnimationEnd3MS; |
252 mini_title_animation_.reset(new ui::MultiAnimation( | 251 mini_title_animation_.reset(new ui::MultiAnimation(parts)); |
253 parts, | |
254 base::TimeDelta::FromMilliseconds( | |
255 kMiniTitleChangeAnimationIntervalMS))); | |
256 mini_title_animation_->SetContainer(animation_container()); | 252 mini_title_animation_->SetContainer(animation_container()); |
257 mini_title_animation_->set_delegate(this); | 253 mini_title_animation_->set_delegate(this); |
258 } | 254 } |
259 mini_title_animation_->Start(); | 255 mini_title_animation_->Start(); |
260 } | 256 } |
261 | 257 |
262 void Tab::StopMiniTabTitleAnimation() { | 258 void Tab::StopMiniTabTitleAnimation() { |
263 if (mini_title_animation_.get()) | 259 if (mini_title_animation_.get()) |
264 mini_title_animation_->Stop(); | 260 mini_title_animation_->Stop(); |
265 } | 261 } |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_RIGHT_SEARCH); | 843 rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_RIGHT_SEARCH); |
848 tab_active_search_.l_width = tab_active_search_.image_l->width(); | 844 tab_active_search_.l_width = tab_active_search_.image_l->width(); |
849 tab_active_search_.r_width = tab_active_search_.image_r->width(); | 845 tab_active_search_.r_width = tab_active_search_.image_r->width(); |
850 | 846 |
851 tab_inactive_.image_l = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_LEFT); | 847 tab_inactive_.image_l = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_LEFT); |
852 tab_inactive_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER); | 848 tab_inactive_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER); |
853 tab_inactive_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT); | 849 tab_inactive_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT); |
854 tab_inactive_.l_width = tab_inactive_.image_l->width(); | 850 tab_inactive_.l_width = tab_inactive_.image_l->width(); |
855 tab_inactive_.r_width = tab_inactive_.image_r->width(); | 851 tab_inactive_.r_width = tab_inactive_.image_r->width(); |
856 } | 852 } |
OLD | NEW |