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

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

Issue 10947046: Eliminate kAshNotifyDisabled and SystemNotification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit Created 8 years, 3 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 | « chrome/browser/feedback/feedback_util.cc ('k') | chrome/browser/ui/views/ash/balloon_collection_impl_ash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notification_service.cc
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index fe49ed2f048c60030e3d74503fe9aae936478394..60096c5e19db1f62f364c2496cb9541b26f9134e 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -44,20 +44,6 @@
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
-#if defined(USE_ASH)
-#include "ash/ash_switches.h"
-#include "base/command_line.h"
-
-namespace {
-
-bool IsAshNotifyEnabled() {
- return !CommandLine::ForCurrentProcess()->HasSwitch(
- ash::switches::kAshNotifyDisabled);
-}
-
-} // namespace
-#endif
-
using content::BrowserThread;
using content::RenderViewHost;
using content::WebContents;
@@ -242,15 +228,13 @@ std::string DesktopNotificationService::AddNotification(
NotificationDelegate* delegate,
Profile* profile) {
#if defined(USE_ASH)
- if (IsAshNotifyEnabled()) {
- // For Ash create a non-HTML notification with |icon_url|.
- Notification notification(GURL(), icon_url, title, message,
- WebKit::WebTextDirectionDefault,
- string16(), replace_id, delegate);
- g_browser_process->notification_ui_manager()->Add(notification, profile);
- return notification.notification_id();
- }
-#endif
+ // For Ash create a non-HTML notification with |icon_url|.
+ Notification notification(GURL(), icon_url, title, message,
+ WebKit::WebTextDirectionDefault,
+ string16(), replace_id, delegate);
+ g_browser_process->notification_ui_manager()->Add(notification, profile);
+ return notification.notification_id();
+#else
// Generate a data URL embedding the icon URL, title, and message.
GURL content_url(CreateDataUrl(
icon_url, title, message, WebKit::WebTextDirectionDefault));
@@ -258,6 +242,7 @@ std::string DesktopNotificationService::AddNotification(
GURL(), content_url, string16(), replace_id, delegate);
g_browser_process->notification_ui_manager()->Add(notification, profile);
return notification.notification_id();
+#endif
}
// static
@@ -270,20 +255,19 @@ std::string DesktopNotificationService::AddIconNotification(
NotificationDelegate* delegate,
Profile* profile) {
#if defined(USE_ASH)
- if (IsAshNotifyEnabled()) {
- // For Ash create a non-HTML notification with |icon|.
- Notification notification(GURL(), icon, title, message,
- WebKit::WebTextDirectionDefault,
- string16(), replace_id, delegate);
- g_browser_process->notification_ui_manager()->Add(notification, profile);
- return notification.notification_id();
- }
-#endif
+ // For Ash create a non-HTML notification with |icon|.
+ Notification notification(GURL(), icon, title, message,
+ WebKit::WebTextDirectionDefault,
+ string16(), replace_id, delegate);
+ g_browser_process->notification_ui_manager()->Add(notification, profile);
+ return notification.notification_id();
+#else
GURL icon_url;
if (!icon.isNull())
icon_url = GURL(web_ui_util::GetImageDataUrl(icon));
return AddNotification(
origin_url, title, message, icon_url, replace_id, delegate, profile);
+#endif
}
// static
« no previous file with comments | « chrome/browser/feedback/feedback_util.cc ('k') | chrome/browser/ui/views/ash/balloon_collection_impl_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698