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

Side by Side Diff: chrome/browser/notifications/platform_notification_service_impl.cc

Issue 1422193003: UMA for Notification action buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment explaining histogramEnumeration Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/notifications/platform_notification_service_impl.h" 5 #include "chrome/browser/notifications/platform_notification_service_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/user_metrics_action.h" 9 #include "base/metrics/user_metrics_action.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 kInvalidRenderProcessId); 111 kInvalidRenderProcessId);
112 112
113 // TODO(peter): Change this to a CHECK() when Issue 555572 is resolved. 113 // TODO(peter): Change this to a CHECK() when Issue 555572 is resolved.
114 // Also change this method to be const again. 114 // Also change this method to be const again.
115 if (permission != blink::WebNotificationPermissionAllowed) { 115 if (permission != blink::WebNotificationPermissionAllowed) {
116 content::RecordAction(base::UserMetricsAction( 116 content::RecordAction(base::UserMetricsAction(
117 "Notifications.Persistent.ClickedWithoutPermission")); 117 "Notifications.Persistent.ClickedWithoutPermission"));
118 return; 118 return;
119 } 119 }
120 120
121 content::RecordAction( 121 if (action_index == -1) {
122 base::UserMetricsAction("Notifications.Persistent.Clicked")); 122 content::RecordAction(base::UserMetricsAction(
123 "Notifications.Persistent.Clicked"));
124 } else {
125 content::RecordAction(base::UserMetricsAction(
126 "Notifications.Persistent.ClickedActionButton"));
127 }
123 128
124 content::NotificationEventDispatcher::GetInstance() 129 content::NotificationEventDispatcher::GetInstance()
125 ->DispatchNotificationClickEvent( 130 ->DispatchNotificationClickEvent(
126 browser_context, 131 browser_context,
127 persistent_notification_id, 132 persistent_notification_id,
128 origin, 133 origin,
129 action_index, 134 action_index,
130 base::Bind(&OnEventDispatchComplete)); 135 base::Bind(&OnEventDispatchComplete));
131 } 136 }
132 137
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( 463 extensions::ExtensionRegistry::Get(profile)->GetExtensionById(
459 origin.host(), extensions::ExtensionRegistry::EVERYTHING); 464 origin.host(), extensions::ExtensionRegistry::EVERYTHING);
460 DCHECK(extension); 465 DCHECK(extension);
461 466
462 return base::UTF8ToUTF16(extension->name()); 467 return base::UTF8ToUTF16(extension->name());
463 } 468 }
464 #endif 469 #endif
465 470
466 return base::string16(); 471 return base::string16();
467 } 472 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698