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

Unified Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 231723006: Remove balloon notification code. The last user was the Linux GTK port but that's deleted now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync past sadrul's r262988 which removed mac/views Created 6 years, 8 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/notifications/desktop_notification_service.cc
===================================================================
--- chrome/browser/notifications/desktop_notification_service.cc (revision 263011)
+++ chrome/browser/notifications/desktop_notification_service.cc (working copy)
@@ -384,63 +384,21 @@
}
// static
-std::string DesktopNotificationService::AddNotification(
+std::string DesktopNotificationService::AddIconNotification(
const GURL& origin_url,
const base::string16& title,
const base::string16& message,
- const GURL& icon_url,
+ const gfx::Image& icon,
const base::string16& replace_id,
NotificationDelegate* delegate,
Profile* profile) {
- if (message_center::IsRichNotificationEnabled()) {
- // For message center create a non-HTML notification with |icon_url|.
- Notification notification(origin_url, icon_url, title, message,
- blink::WebTextDirectionDefault,
- base::string16(), replace_id, delegate);
- g_browser_process->notification_ui_manager()->Add(notification, profile);
- return notification.notification_id();
- }
-
- // Generate a data URL embedding the icon URL, title, and message.
- GURL content_url(CreateDataUrl(
- icon_url, title, message, blink::WebTextDirectionDefault));
- Notification notification(
- GURL(), content_url, base::string16(), replace_id, delegate);
+ Notification notification(origin_url, icon, title, message,
+ blink::WebTextDirectionDefault,
+ base::string16(), replace_id, delegate);
g_browser_process->notification_ui_manager()->Add(notification, profile);
return notification.notification_id();
stevenjb 2014/04/10 17:32:03 It looks like we only call this twice, we could ju
jam 2014/04/10 20:10:00 yeah i'd prefer to keep it as simple as possible :
}
-// static
-std::string DesktopNotificationService::AddIconNotification(
- const GURL& origin_url,
- const base::string16& title,
- const base::string16& message,
- const gfx::Image& icon,
- const base::string16& replace_id,
- NotificationDelegate* delegate,
- Profile* profile) {
- if (message_center::IsRichNotificationEnabled()) {
- // For message center create a non-HTML notification with |icon|.
- Notification notification(origin_url, icon, title, message,
- blink::WebTextDirectionDefault,
- base::string16(), replace_id, delegate);
- g_browser_process->notification_ui_manager()->Add(notification, profile);
- return notification.notification_id();
- }
-
- GURL icon_url;
- if (!icon.IsEmpty())
- icon_url = GURL(webui::GetBitmapDataUrl(*icon.ToSkBitmap()));
- return AddNotification(
- origin_url, title, message, icon_url, replace_id, delegate, profile);
-}
-
-// static
-void DesktopNotificationService::RemoveNotification(
- const std::string& notification_id) {
- g_browser_process->notification_ui_manager()->CancelById(notification_id);
-}
-
DesktopNotificationService::DesktopNotificationService(
Profile* profile,
NotificationUIManager* ui_manager)
@@ -635,10 +593,7 @@
base::string16 DesktopNotificationService::DisplayNameForOriginInProcessId(
const GURL& origin, int process_id) {
// If the source is an extension, lookup the display name.
- // Message center prefers to use extension name if the notification
- // is allowed by an extension.
- if (NotificationUIManager::DelegatesToMessageCenter() ||
- origin.SchemeIs(extensions::kExtensionScheme)) {
+ if (origin.SchemeIs(extensions::kExtensionScheme)) {
extensions::InfoMap* extension_info_map =
extensions::ExtensionSystem::Get(profile_)->info_map();
if (extension_info_map) {
@@ -746,8 +701,7 @@
void DesktopNotificationService::ShowWelcomeNotificationIfNecessary(
const Notification& notification) {
- if (!chrome_now_welcome_notification_ &&
- message_center::IsRichNotificationEnabled()) {
+ if (!chrome_now_welcome_notification_) {
chrome_now_welcome_notification_ =
ExtensionWelcomeNotification::Create(kChromeNowExtensionID, profile_);
}

Powered by Google App Engine
This is Rietveld 408576698