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

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

Issue 7065037: Fix crash when creating a desktop shortcut for apps with a missing icon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/create_application_shortcut_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d28e71ae41e6b7ef6779e2bba8d3e07e16172866..7f2f72856fdd11b5d716c34b63ef9a51987e6c36 100644
--- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/web_applications/web_app_ui.h"
+#include "chrome/browser/ui/webui/extension_icon_source.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_resource.h"
#include "content/browser/browser_thread.h"
@@ -20,6 +21,7 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
+#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/gtk_util.h"
@@ -324,10 +326,9 @@ CreateChromeApplicationShortcutsDialogGtk::
// Called by tracker_ when the app's icon is loaded.
void CreateChromeApplicationShortcutsDialogGtk::OnImageLoaded(
SkBitmap* image, const ExtensionResource& resource, int index) {
- if (image->isNull()) {
- NOTREACHED() << "Corrupt image in profile?";
- return;
- }
+ if (!image || image->isNull())
+ image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON);
+
shortcut_info_.favicon = *image;
CreateIconPixBuf(*image);
« no previous file with comments | « no previous file | chrome/browser/ui/views/create_application_shortcut_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698