diff options
author | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 23:14:37 +0000 |
---|---|---|
committer | stevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 23:14:37 +0000 |
commit | e9abea4d758cc579079d7763b430d09b987a4f64 (patch) | |
tree | d0c2fa833c974d34d7916c704d816185dfb12393 /chrome/browser/background | |
parent | 4e76528d453e7aae31bc646a93448ca44c7cb19a (diff) | |
download | chromium_src-e9abea4d758cc579079d7763b430d09b987a4f64.zip chromium_src-e9abea4d758cc579079d7763b430d09b987a4f64.tar.gz chromium_src-e9abea4d758cc579079d7763b430d09b987a4f64.tar.bz2 |
Add DesktopNotificationService::AddNotification
Convert BackgroundContentsService, FileBrowserNotifications, CloudPrintProxyService, and DesktopNotificationBalloon to use DesktopNotificationService::AdddNotification.
Includes some significant re-factoring of FileBrowserNotifications to support Ash notifications (apologies).
BUG=124914
TEST=Notification tests pass. Desktop notifications (e.g. cloud print, file browser) work with --ash-notify
For CloudPrintProxyService:
TBR=scottbyer@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10548052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142259 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background')
-rw-r--r-- | chrome/browser/background/background_contents_service.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index c1edaba..86cfb1f 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -108,18 +108,16 @@ class CrashNotificationDelegate : public NotificationDelegate { void ShowBalloon(const Extension* extension, Profile* profile) { #if defined(ENABLE_NOTIFICATIONS) + string16 title; // no notifiaction title string16 message = l10n_util::GetStringFUTF16( extension->is_app() ? IDS_BACKGROUND_CRASHED_APP_BALLOON_MESSAGE : IDS_BACKGROUND_CRASHED_EXTENSION_BALLOON_MESSAGE, UTF8ToUTF16(extension->name())); - string16 content_url = DesktopNotificationService::CreateDataUrl( - extension->GetIconURL(ExtensionIconSet::EXTENSION_ICON_SMALLISH, - ExtensionIconSet::MATCH_BIGGER), - string16(), message, WebKit::WebTextDirectionDefault); - Notification notification( - extension->url(), GURL(content_url), string16(), string16(), - new CrashNotificationDelegate(profile, extension)); - g_browser_process->notification_ui_manager()->Add(notification, profile); + GURL icon_url(extension->GetIconURL(ExtensionIconSet::EXTENSION_ICON_SMALLISH, + ExtensionIconSet::MATCH_BIGGER)); + DesktopNotificationService::AddNotification( + extension->url(), title, message, icon_url, + new CrashNotificationDelegate(profile, extension), profile); #endif } |