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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 if (!loading_only) { | 330 if (!loading_only) { |
331 data_.title = contents->GetTitle(); | 331 data_.title = contents->GetTitle(); |
332 data_.incognito = contents->GetBrowserContext()->IsOffTheRecord(); | 332 data_.incognito = contents->GetBrowserContext()->IsOffTheRecord(); |
333 data_.crashed = contents->IsCrashed(); | 333 data_.crashed = contents->IsCrashed(); |
334 | 334 |
335 SkBitmap* app_icon = | 335 SkBitmap* app_icon = |
336 tab_contents->extension_tab_helper()->GetExtensionAppIcon(); | 336 tab_contents->extension_tab_helper()->GetExtensionAppIcon(); |
337 if (app_icon) { | 337 if (app_icon) { |
338 data_.favicon = *app_icon; | 338 data_.favicon = *app_icon; |
339 } else { | 339 } else { |
340 data_.favicon = | 340 const gfx::Image& icon = tab_contents->favicon_tab_helper()->GetFavicon(); |
341 tab_contents->favicon_tab_helper()->GetFavicon().AsBitmap(); | 341 data_.favicon = icon.IsEmpty() ? SkBitmap() : *icon.ToSkBitmap(); |
342 } | 342 } |
343 | 343 |
344 data_.app = app; | 344 data_.app = app; |
345 | 345 |
346 // Make a cairo cached version of the favicon. | 346 // Make a cairo cached version of the favicon. |
347 if (!data_.favicon.isNull()) { | 347 if (!data_.favicon.isNull()) { |
348 // Instead of resizing the icon during each frame, create our resized | 348 // Instead of resizing the icon during each frame, create our resized |
349 // icon resource now, send it to the xserver and use that each frame | 349 // icon resource now, send it to the xserver and use that each frame |
350 // instead. | 350 // instead. |
351 | 351 |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 GdkPixbuf* tab_close = rb.GetNativeImageNamed(IDR_TAB_CLOSE).ToGdkPixbuf(); | 1121 GdkPixbuf* tab_close = rb.GetNativeImageNamed(IDR_TAB_CLOSE).ToGdkPixbuf(); |
1122 close_button_width_ = gdk_pixbuf_get_width(tab_close); | 1122 close_button_width_ = gdk_pixbuf_get_width(tab_close); |
1123 close_button_height_ = gdk_pixbuf_get_height(tab_close); | 1123 close_button_height_ = gdk_pixbuf_get_height(tab_close); |
1124 | 1124 |
1125 const gfx::Font& base_font = rb.GetFont(ui::ResourceBundle::BaseFont); | 1125 const gfx::Font& base_font = rb.GetFont(ui::ResourceBundle::BaseFont); |
1126 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); | 1126 title_font_ = new gfx::Font(base_font.GetFontName(), kFontPixelSize); |
1127 title_font_height_ = title_font_->GetHeight(); | 1127 title_font_height_ = title_font_->GetHeight(); |
1128 | 1128 |
1129 initialized_ = true; | 1129 initialized_ = true; |
1130 } | 1130 } |
OLD | NEW |