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

Unified Diff: chrome/browser/notifications/google_now_notification_stats_collector.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/google_now_notification_stats_collector.cc
diff --git a/chrome/browser/notifications/google_now_notification_stats_collector.cc b/chrome/browser/notifications/google_now_notification_stats_collector.cc
index 5ab6e61551b02b4ec241bedf3f57e8cd91362663..1e980c248e3b1015cea68cd8b5225977ccdc5ff0 100644
--- a/chrome/browser/notifications/google_now_notification_stats_collector.cc
+++ b/chrome/browser/notifications/google_now_notification_stats_collector.cc
@@ -8,13 +8,13 @@
#include "base/metrics/sparse_histogram.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/notifications/extension_welcome_notification.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "content/public/browser/user_metrics.h"
#include "ui/message_center/notification.h"
namespace {
-const char kChromeNowExtensionID[] = "pafkbggdmjlpgkdkcbjmhmfcdpncadgh";
const int kNotificationsMaxCount = 20;
}
@@ -57,7 +57,8 @@ bool GoogleNowNotificationStatsCollector::IsNotificationIdForGoogleNow(
isGoogleNowNotification =
((notification->notifier_id().type ==
message_center::NotifierId::APPLICATION) &&
- (notification->notifier_id().id == kChromeNowExtensionID));
+ (notification->notifier_id().id ==
+ ExtensionWelcomeNotification::kChromeNowExtensionID));
}
return isGoogleNowNotification;
}
@@ -70,7 +71,8 @@ int GoogleNowNotificationStatsCollector::CountVisibleGoogleNowNotifications() {
for (Notifications::iterator iter = visible_notifications.begin();
iter != visible_notifications.end();
++iter) {
- if ((*iter)->notifier_id().id == kChromeNowExtensionID)
+ if ((*iter)->notifier_id().id ==
+ ExtensionWelcomeNotification::kChromeNowExtensionID)
google_now_notification_count++;
}
return google_now_notification_count;

Powered by Google App Engine
This is Rietveld 408576698