Skip to content

Commit

Permalink
Allow chrome.notifications to have icons on Linux.
Browse files Browse the repository at this point in the history
Due to a typo, balloons don't actually contain the image content they need
when created via chrome.notifications.

BUG=294436

Review URL: https://chromiumcodereview.appspot.com/23796013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224169 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dewittj@chromium.org committed Sep 19, 2013
1 parent dc231f6 commit 58e0adb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chrome/browser/notifications/notification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ Notification::Notification(
is_html_(false),
replace_id_(replace_id),
delegate_(delegate) {
// It's important to leave |icon_url_| empty with rich notifications enabled,
// to prevent "Downloading" the data url and overwriting the existing |icon|.
if (!message_center::IsRichNotificationEnabled()) {
// "Upconvert" the string parameters to a data: URL. Some balloon views
// require content URL to render anything, so this serves as a backup.
GURL icon_url;
if (!icon.IsEmpty())
icon_url_ = GURL(webui::GetBitmapDataUrl(*icon.ToSkBitmap()));
content_url_ = GURL(
DesktopNotificationService::CreateDataUrl(icon_url, title, body, dir));
DesktopNotificationService::CreateDataUrl(icon_url_, title, body, dir));
}
}

Expand Down

0 comments on commit 58e0adb

Please sign in to comment.