Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: chrome/browser/ui/gtk/browser_titlebar.cc

Issue 10834368: Convert mostly favicon related code from SkBitmap to ImageSkia and Image (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/browser_titlebar.cc
diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc
index 29320226e9aaac3b41d3b5b3ee4d448fa9c3a8dc..fb54ca2e6e08389cfbe867884364464738db240d 100644
--- a/chrome/browser/ui/gtk/browser_titlebar.cc
+++ b/chrome/browser/ui/gtk/browser_titlebar.cc
@@ -601,11 +601,11 @@ void BrowserTitlebar::UpdateTitleAndIcon() {
// top left of the custom frame, that will get updated when the
// throbber is updated.
Profile* profile = browser_window_->browser()->profile();
- SkBitmap icon = browser_window_->browser()->GetCurrentPageIcon();
- if (icon.empty()) {
+ gfx::Image icon = browser_window_->browser()->GetCurrentPageIcon();
+ if (icon.IsEmpty()) {
gtk_util::SetWindowIcon(window_, profile);
} else {
- GdkPixbuf* icon_pixbuf = gfx::GdkPixbufFromSkBitmap(icon);
+ GdkPixbuf* icon_pixbuf = icon.ToGdkPixbuf();
gtk_util::SetWindowIcon(window_, profile, icon_pixbuf);
g_object_unref(icon_pixbuf);
Nico 2012/08/16 20:26:27 ToGdkPixbuf() returns an unref'd icon, so you need
}
@@ -636,13 +636,13 @@ void BrowserTitlebar::UpdateThrobber(WebContents* web_contents) {
// Note: we want to exclude the application popup/panel window.
if ((browser_window_->browser()->is_app() &&
!browser_window_->browser()->is_type_tabbed())) {
- SkBitmap icon = browser_window_->browser()->GetCurrentPageIcon();
- if (icon.empty()) {
+ gfx::Image icon = browser_window_->browser()->GetCurrentPageIcon();
+ if (icon.IsEmpty()) {
// Fallback to the Chromium icon if the page has no icon.
gtk_image_set_from_pixbuf(GTK_IMAGE(app_mode_favicon_),
rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_16).ToGdkPixbuf());
} else {
- GdkPixbuf* icon_pixbuf = gfx::GdkPixbufFromSkBitmap(icon);
+ GdkPixbuf* icon_pixbuf = icon.ToGdkPixbuf();
gtk_image_set_from_pixbuf(GTK_IMAGE(app_mode_favicon_), icon_pixbuf);
g_object_unref(icon_pixbuf);
Nico 2012/08/16 20:26:27 ditto
}

Powered by Google App Engine
This is Rietveld 408576698