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

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

Issue 580093003: Factor Google Now welcome notifications out of DesktopNotificationService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
Index: chrome/browser/notifications/extension_welcome_notification.cc
diff --git a/chrome/browser/notifications/extension_welcome_notification.cc b/chrome/browser/notifications/extension_welcome_notification.cc
index dd3a82aa911a0c1ceeaffb88d2094b19b5150b73..def1e0124eda03a5be3284c823aacca88852f034 100644
--- a/chrome/browser/notifications/extension_welcome_notification.cc
+++ b/chrome/browser/notifications/extension_welcome_notification.cc
@@ -27,6 +27,8 @@
#include "ui/message_center/notification_types.h"
const int ExtensionWelcomeNotification::kRequestedShowTimeDays = 14;
+const char ExtensionWelcomeNotification::kChromeNowExtensionID[] =
+ "pafkbggdmjlpgkdkcbjmhmfcdpncadgh";
namespace {
@@ -135,10 +137,10 @@ class DefaultDelegate : public ExtensionWelcomeNotification::Delegate {
} // namespace
ExtensionWelcomeNotification::ExtensionWelcomeNotification(
- const std::string& extension_id,
Profile* const profile,
ExtensionWelcomeNotification::Delegate* const delegate)
- : notifier_id_(message_center::NotifierId::APPLICATION, extension_id),
+ : notifier_id_(message_center::NotifierId::APPLICATION,
+ kChromeNowExtensionID),
profile_(profile),
delegate_(delegate) {
welcome_notification_dismissed_pref_.Init(
@@ -153,19 +155,15 @@ ExtensionWelcomeNotification::ExtensionWelcomeNotification(
}
// static
-scoped_ptr<ExtensionWelcomeNotification> ExtensionWelcomeNotification::Create(
- const std::string& extension_id,
+ExtensionWelcomeNotification* ExtensionWelcomeNotification::Create(
Profile* const profile) {
- return Create(extension_id, profile, new DefaultDelegate()).Pass();
+ return Create(profile, new DefaultDelegate());
}
// static
-scoped_ptr<ExtensionWelcomeNotification> ExtensionWelcomeNotification::Create(
- const std::string& extension_id,
- Profile* const profile,
- Delegate* const delegate) {
- return scoped_ptr<ExtensionWelcomeNotification>(
- new ExtensionWelcomeNotification(extension_id, profile, delegate)).Pass();
+ExtensionWelcomeNotification* ExtensionWelcomeNotification::Create(
+ Profile* const profile, Delegate* const delegate) {
+ return new ExtensionWelcomeNotification(profile, delegate);
}
ExtensionWelcomeNotification::~ExtensionWelcomeNotification() {

Powered by Google App Engine
This is Rietveld 408576698