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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 12375006: Added UMA stats for extensions events on addListener. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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/omnibox/omnibox_api.cc
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
index 55a6ee7689c27e467c7926fe35aebedbc8e0d050..024063d9ea10689988b530ece18e958aec06dc65 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -28,12 +28,12 @@
#include "content/public/browser/notification_service.h"
#include "ui/gfx/image/image.h"
-namespace events {
+namespace event_names {
const char kOnInputStarted[] = "omnibox.onInputStarted";
const char kOnInputChanged[] = "omnibox.onInputChanged";
const char kOnInputEntered[] = "omnibox.onInputEntered";
const char kOnInputCancelled[] = "omnibox.onInputCancelled";
-} // namespace events
+} // namespace event_names
namespace extensions {
@@ -64,7 +64,7 @@ static const int kOmniboxIconPaddingRight = 0;
void ExtensionOmniboxEventRouter::OnInputStarted(
Profile* profile, const std::string& extension_id) {
scoped_ptr<Event> event(new Event(
- events::kOnInputStarted, make_scoped_ptr(new ListValue())));
+ event_names::kOnInputStarted, make_scoped_ptr(new ListValue())));
event->restrict_to_profile = profile;
ExtensionSystem::Get(profile)->event_router()->
DispatchEventToExtension(extension_id, event.Pass());
@@ -75,14 +75,14 @@ bool ExtensionOmniboxEventRouter::OnInputChanged(
Profile* profile, const std::string& extension_id,
const std::string& input, int suggest_id) {
if (!extensions::ExtensionSystem::Get(profile)->event_router()->
- ExtensionHasEventListener(extension_id, events::kOnInputChanged))
+ ExtensionHasEventListener(extension_id, event_names::kOnInputChanged))
return false;
scoped_ptr<ListValue> args(new ListValue());
args->Set(0, Value::CreateStringValue(input));
args->Set(1, Value::CreateIntegerValue(suggest_id));
- scoped_ptr<Event> event(new Event(events::kOnInputChanged, args.Pass()));
+ scoped_ptr<Event> event(new Event(event_names::kOnInputChanged, args.Pass()));
event->restrict_to_profile = profile;
ExtensionSystem::Get(profile)->event_router()->
DispatchEventToExtension(extension_id, event.Pass());
@@ -107,7 +107,7 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
scoped_ptr<ListValue> args(new ListValue());
args->Set(0, Value::CreateStringValue(input));
- scoped_ptr<Event> event(new Event(events::kOnInputEntered, args.Pass()));
+ scoped_ptr<Event> event(new Event(event_names::kOnInputEntered, args.Pass()));
event->restrict_to_profile = profile;
ExtensionSystem::Get(profile)->event_router()->
DispatchEventToExtension(extension_id, event.Pass());
@@ -122,7 +122,7 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
void ExtensionOmniboxEventRouter::OnInputCancelled(
Profile* profile, const std::string& extension_id) {
scoped_ptr<Event> event(new Event(
- events::kOnInputCancelled, make_scoped_ptr(new ListValue())));
+ event_names::kOnInputCancelled, make_scoped_ptr(new ListValue())));
event->restrict_to_profile = profile;
ExtensionSystem::Get(profile)->event_router()->
DispatchEventToExtension(extension_id, event.Pass());

Powered by Google App Engine
This is Rietveld 408576698