Index: chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc |
diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc |
index 92c8bfacfa70c9d504daec6f61c722be24161bd9..240c2cd96ba7a0e59deb8b91fe0304888f7eb5f0 100644 |
--- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc |
+++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc |
@@ -26,6 +26,7 @@ |
#include "ui/base/gtk/gtk_hig_constants.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/gfx/gtk_util.h" |
+#include "ui/gfx/image/image.h" |
using content::BrowserThread; |
@@ -66,10 +67,10 @@ CreateApplicationShortcutsDialogGtk::CreateApplicationShortcutsDialogGtk( |
} |
void CreateApplicationShortcutsDialogGtk::CreateIconPixBuf( |
- const SkBitmap& bitmap) { |
+ const gfx::Image& image) { |
// Prepare the icon. Try to scale it if it's too small, otherwise it would |
// look weird. |
- GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&shortcut_info_.favicon); |
+ GdkPixbuf* pixbuf = image.ToGdkPixbuf(); |
int pixbuf_width = gdk_pixbuf_get_width(pixbuf); |
int pixbuf_height = gdk_pixbuf_get_height(pixbuf); |
if (pixbuf_width == pixbuf_height && pixbuf_width < kIconPreviewSizePixels) { |
@@ -332,12 +333,16 @@ CreateChromeApplicationShortcutsDialogGtk:: |
// Called by tracker_ when the app's icon is loaded. |
void CreateChromeApplicationShortcutsDialogGtk::OnImageLoaded( |
- SkBitmap* image, const ExtensionResource& resource, int index) { |
- if (!image || image->isNull()) |
- image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); |
- |
- shortcut_info_.favicon = *image; |
+ const gfx::Image* image, |
+ const std::string& extension_id, |
+ int index) OVERRIDE { |
+ if (!image || image->IsEmpty()) { |
+ shortcut_info_.favicon = |
+ ResourceBundle::GetSharedInstance().GetImageNamed(IDR_APP_DEFAULT_ICON); |
+ } else { |
+ shortcut_info_.favicon = *image; |
+ } |
- CreateIconPixBuf(*image); |
+ CreateIconPixBuf(shortcut_info_.favicon); |
CreateDialogBox(parent_); |
} |