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

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: rebase again Created 5 years, 2 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') | no next file with comments »
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 5db2c74a1a00b049c0f8c7bea8bea2f8a1d08af5..cc5d2ae8c664113065e24091f06c6ff9da1414e1 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -6,6 +6,7 @@
#include "base/command_line.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"
@@ -31,6 +32,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/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -99,6 +101,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,
@@ -113,6 +118,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();
@@ -279,6 +287,8 @@ void PlatformNotificationServiceImpl::DisplayPersistentNotification(
persistent_notifications_[persistent_notification_id] = notification.id();
GetNotificationUIManager()->Add(notification, profile);
+ content::RecordAction(
+ base::UserMetricsAction("Notifications.Persistent.Shown"));
HostContentSettingsMapFactory::GetForProfile(profile)->UpdateLastUsage(
origin, origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698