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/gtk/tabs/tab_renderer_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 if (loading_animation_.animation_state() != ANIMATION_NONE) { | 863 if (loading_animation_.animation_state() != ANIMATION_NONE) { |
864 PaintLoadingAnimation(widget, cr); | 864 PaintLoadingAnimation(widget, cr); |
865 return; | 865 return; |
866 } | 866 } |
867 | 867 |
868 gfx::CairoCachedSurface* to_display = NULL; | 868 gfx::CairoCachedSurface* to_display = NULL; |
869 if (should_display_crashed_favicon_) { | 869 if (should_display_crashed_favicon_) { |
870 to_display = theme_service_->GetImageNamed(IDR_SAD_FAVICON)->ToCairo(); | 870 to_display = theme_service_->GetImageNamed(IDR_SAD_FAVICON)->ToCairo(); |
871 } else if (!data_.favicon.isNull()) { | 871 } else if (!data_.favicon.isNull()) { |
872 if (data_.is_default_favicon && theme_service_->UsingNativeTheme()) { | 872 if (data_.is_default_favicon && theme_service_->UsingNativeTheme()) { |
873 to_display = GtkThemeService::GetDefaultFavicon(true)->ToCairo(); | 873 to_display = GtkThemeService::GetDefaultFavicon(true).ToCairo(); |
874 } else if (data_.cairo_favicon.valid()) { | 874 } else if (data_.cairo_favicon.valid()) { |
875 to_display = &data_.cairo_favicon; | 875 to_display = &data_.cairo_favicon; |
876 } | 876 } |
877 } | 877 } |
878 | 878 |
879 if (to_display) { | 879 if (to_display) { |
880 to_display->SetSource(cr, | 880 to_display->SetSource(cr, |
881 widget, | 881 widget, |
882 favicon_bounds_.x(), | 882 favicon_bounds_.x(), |
883 favicon_bounds_.y() + favicon_hiding_offset_); | 883 favicon_bounds_.y() + favicon_hiding_offset_); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 GdkPixbuf* tab_close = rb.GetNativeImageNamed(IDR_TAB_CLOSE).ToGdkPixbuf(); | 1123 GdkPixbuf* tab_close = rb.GetNativeImageNamed(IDR_TAB_CLOSE).ToGdkPixbuf(); |
1124 close_button_width_ = gdk_pixbuf_get_width(tab_close); | 1124 close_button_width_ = gdk_pixbuf_get_width(tab_close); |
1125 close_button_height_ = gdk_pixbuf_get_height(tab_close); | 1125 close_button_height_ = gdk_pixbuf_get_height(tab_close); |
1126 | 1126 |
1127 const gfx::Font& base_font = rb.GetFont(ui::ResourceBundle::BaseFont); | 1127 const gfx::Font& base_font = rb.GetFont(ui::ResourceBundle::BaseFont); |
1128 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); | 1128 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); |
1129 title_font_height_ = title_font_->GetHeight(); | 1129 title_font_height_ = title_font_->GetHeight(); |
1130 | 1130 |
1131 initialized_ = true; | 1131 initialized_ = true; |
1132 } | 1132 } |
OLD | NEW |