OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/tabs/tab_renderer.h" |
| 6 |
5 #include <limits> | 7 #include <limits> |
6 | 8 |
7 #include "chrome/browser/views/tabs/tab_renderer.h" | |
8 | |
9 #include "app/gfx/chrome_canvas.h" | 9 #include "app/gfx/chrome_canvas.h" |
10 #include "app/gfx/chrome_font.h" | 10 #include "app/gfx/chrome_font.h" |
11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
13 #include "app/win_util.h" | 13 #include "app/win_util.h" |
14 #include "chrome/browser/browser.h" | 14 #include "chrome/browser/browser.h" |
15 #include "chrome/browser/browser_theme_provider.h" | 15 #include "chrome/browser/browser_theme_provider.h" |
16 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
17 #include "chrome/browser/tab_contents/tab_contents.h" | 17 #include "chrome/browser/tab_contents/tab_contents.h" |
18 #include "chrome/browser/tabs/tab_strip_model.h" | 18 #include "chrome/browser/tabs/tab_strip_model.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } // namespace | 167 } // namespace |
168 | 168 |
169 //////////////////////////////////////////////////////////////////////////////// | 169 //////////////////////////////////////////////////////////////////////////////// |
170 // FaviconCrashAnimation | 170 // FaviconCrashAnimation |
171 // | 171 // |
172 // A custom animation subclass to manage the favicon crash animation. | 172 // A custom animation subclass to manage the favicon crash animation. |
173 class TabRenderer::FavIconCrashAnimation : public Animation, | 173 class TabRenderer::FavIconCrashAnimation : public Animation, |
174 public AnimationDelegate { | 174 public AnimationDelegate { |
175 public: | 175 public: |
176 explicit FavIconCrashAnimation(TabRenderer* target) | 176 explicit FavIconCrashAnimation(TabRenderer* target) |
177 : Animation(1000, 25, this), | 177 : ALLOW_THIS_IN_INITIALIZER_LIST(Animation(1000, 25, this)), |
178 target_(target) { | 178 target_(target) { |
179 } | 179 } |
180 virtual ~FavIconCrashAnimation() {} | 180 virtual ~FavIconCrashAnimation() {} |
181 | 181 |
182 // Animation overrides: | 182 // Animation overrides: |
183 virtual void AnimateToState(double state) { | 183 virtual void AnimateToState(double state) { |
184 const double kHidingOffset = 27; | 184 const double kHidingOffset = 27; |
185 | 185 |
186 if (state < .5) { | 186 if (state < .5) { |
187 target_->SetFavIconHidingOffset( | 187 target_->SetFavIconHidingOffset( |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 783 tab_inactive.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
784 tab_inactive.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 784 tab_inactive.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
785 tab_inactive.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 785 tab_inactive.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
786 | 786 |
787 tab_inactive.l_width = tab_inactive.image_l->width(); | 787 tab_inactive.l_width = tab_inactive.image_l->width(); |
788 tab_inactive.r_width = tab_inactive.image_r->width(); | 788 tab_inactive.r_width = tab_inactive.image_r->width(); |
789 | 789 |
790 loading_animation_frames = rb.GetBitmapNamed(IDR_THROBBER); | 790 loading_animation_frames = rb.GetBitmapNamed(IDR_THROBBER); |
791 waiting_animation_frames = rb.GetBitmapNamed(IDR_THROBBER_WAITING); | 791 waiting_animation_frames = rb.GetBitmapNamed(IDR_THROBBER_WAITING); |
792 } | 792 } |
OLD | NEW |