OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |