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

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

Issue 1315193011: Add use counters for persistent notification interaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | tools/metrics/actions/actions.xml » ('j') | tools/metrics/actions/actions.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/platform_notification_service_impl.cc
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index 560fa06a4895842b35789cd800836a542d8ee8fb..4f93a577edf32655f8a4ff286953253107f73e21 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/notifications/platform_notification_service_impl.h"
#include "base/metrics/histogram_macros.h"
+#include "base/metrics/user_metrics_action.h"
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
@@ -23,6 +24,7 @@
#include "content/public/browser/notification_event_dispatcher.h"
#include "content/public/browser/platform_notification_context.h"
#include "content/public/browser/storage_partition.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/common/platform_notification_data.h"
#include "ui/message_center/notifier_settings.h"
#include "url/url_constants.h"
@@ -88,6 +90,9 @@ void PlatformNotificationServiceImpl::OnPersistentNotificationClick(
const GURL& origin,
int action_index) const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ content::RecordAction(
+ base::UserMetricsAction("Notifications.Persistent.Clicked"));
+
content::NotificationEventDispatcher::GetInstance()
->DispatchNotificationClickEvent(
browser_context,
@@ -102,6 +107,9 @@ void PlatformNotificationServiceImpl::OnPersistentNotificationClose(
int64_t persistent_notification_id,
const GURL& origin) const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ content::RecordAction(
+ base::UserMetricsAction("Notifications.Persistent.Closed"));
+
PlatformNotificationContext* context =
BrowserContext::GetStoragePartitionForSite(browser_context, origin)
->GetPlatformNotificationContext();
@@ -262,6 +270,8 @@ void PlatformNotificationServiceImpl::DisplayPersistentNotification(
persistent_notifications_[persistent_notification_id] = notification.id();
GetNotificationUIManager()->Add(notification, profile);
+ content::RecordAction(
+ base::UserMetricsAction("Notifications.Persistent.Shown"));
profile->GetHostContentSettingsMap()->UpdateLastUsage(
origin, origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | tools/metrics/actions/actions.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698