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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_api.cc

Issue 1236493004: Final batch adding real histogram values for extension events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android compile Created 5 years, 5 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/extensions/api/notifications/notifications_api.cc
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index 0cbde4162501b77f3781fedd9778e10962c9d6f8..6ca149d885c5ffd11eb11d1f9ace0bd7090e02e0 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -147,14 +147,15 @@ class NotificationsApiDelegate : public NotificationDelegate {
: EventRouter::USER_GESTURE_NOT_ENABLED;
scoped_ptr<base::ListValue> args(CreateBaseEventArgs());
args->Append(new base::FundamentalValue(by_user));
- SendEvent(notifications::OnClosed::kEventName, gesture, args.Pass());
+ SendEvent(events::NOTIFICATIONS_ON_CLOSED,
+ notifications::OnClosed::kEventName, gesture, args.Pass());
}
void Click() override {
scoped_ptr<base::ListValue> args(CreateBaseEventArgs());
- SendEvent(notifications::OnClicked::kEventName,
- EventRouter::USER_GESTURE_ENABLED,
- args.Pass());
+ SendEvent(events::NOTIFICATIONS_ON_CLICKED,
+ notifications::OnClicked::kEventName,
+ EventRouter::USER_GESTURE_ENABLED, args.Pass());
}
bool HasClickedListener() override {
@@ -168,9 +169,9 @@ class NotificationsApiDelegate : public NotificationDelegate {
void ButtonClick(int index) override {
scoped_ptr<base::ListValue> args(CreateBaseEventArgs());
args->Append(new base::FundamentalValue(index));
- SendEvent(notifications::OnButtonClicked::kEventName,
- EventRouter::USER_GESTURE_ENABLED,
- args.Pass());
+ SendEvent(events::NOTIFICATIONS_ON_BUTTON_CLICKED,
+ notifications::OnButtonClicked::kEventName,
+ EventRouter::USER_GESTURE_ENABLED, args.Pass());
}
std::string id() const override { return scoped_id_; }
@@ -178,13 +179,14 @@ class NotificationsApiDelegate : public NotificationDelegate {
private:
~NotificationsApiDelegate() override {}
- void SendEvent(const std::string& name,
+ void SendEvent(events::HistogramValue histogram_value,
+ const std::string& name,
EventRouter::UserGestureState user_gesture,
scoped_ptr<base::ListValue> args) {
if (!event_router_)
return;
- scoped_ptr<Event> event(new Event(events::UNKNOWN, name, args.Pass()));
+ scoped_ptr<Event> event(new Event(histogram_value, name, args.Pass()));
event->user_gesture = user_gesture;
event_router_->DispatchEventToExtension(extension_id_, event.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698