| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/tabs/tab_renderer_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_renderer_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 TabRendererGtk::LoadingAnimation::LoadingAnimation( | 155 TabRendererGtk::LoadingAnimation::LoadingAnimation( |
| 156 const LoadingAnimation::Data& data) | 156 const LoadingAnimation::Data& data) |
| 157 : data_(new Data(data)), | 157 : data_(new Data(data)), |
| 158 theme_provider_(NULL), | 158 theme_provider_(NULL), |
| 159 animation_state_(ANIMATION_NONE), | 159 animation_state_(ANIMATION_NONE), |
| 160 animation_frame_(0) { | 160 animation_frame_(0) { |
| 161 } | 161 } |
| 162 | 162 |
| 163 TabRendererGtk::LoadingAnimation::~LoadingAnimation() {} |
| 164 |
| 163 bool TabRendererGtk::LoadingAnimation::ValidateLoadingAnimation( | 165 bool TabRendererGtk::LoadingAnimation::ValidateLoadingAnimation( |
| 164 AnimationState animation_state) { | 166 AnimationState animation_state) { |
| 165 bool has_changed = false; | 167 bool has_changed = false; |
| 166 if (animation_state_ != animation_state) { | 168 if (animation_state_ != animation_state) { |
| 167 // The waiting animation is the reverse of the loading animation, but at a | 169 // The waiting animation is the reverse of the loading animation, but at a |
| 168 // different rate - the following reverses and scales the animation_frame_ | 170 // different rate - the following reverses and scales the animation_frame_ |
| 169 // so that the frame is at an equivalent position when going from one | 171 // so that the frame is at an equivalent position when going from one |
| 170 // animation to the other. | 172 // animation to the other. |
| 171 if (animation_state_ == ANIMATION_WAITING && | 173 if (animation_state_ == ANIMATION_WAITING && |
| 172 animation_state == ANIMATION_LOADING) { | 174 animation_state == ANIMATION_LOADING) { |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 // Force the font size to 9pt, which matches Windows' default font size | 1073 // Force the font size to 9pt, which matches Windows' default font size |
| 1072 // (taken from the system). | 1074 // (taken from the system). |
| 1073 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); | 1075 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); |
| 1074 title_font_ = new gfx::Font(base_font.GetFontName(), 9); | 1076 title_font_ = new gfx::Font(base_font.GetFontName(), 9); |
| 1075 title_font_height_ = title_font_->GetHeight(); | 1077 title_font_height_ = title_font_->GetHeight(); |
| 1076 | 1078 |
| 1077 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); | 1079 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); |
| 1078 | 1080 |
| 1079 initialized_ = true; | 1081 initialized_ = true; |
| 1080 } | 1082 } |
| OLD | NEW |