summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/extensions/api/identity/identity_api.cc2
-rw-r--r--chrome/browser/extensions/api/identity/web_auth_flow.cc4
-rw-r--r--chrome/browser/extensions/api/image_writer_private/operation_manager.cc10
-rw-r--r--chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc6
-rw-r--r--chrome/browser/extensions/api/mdns/mdns_api.cc5
-rw-r--r--chrome/browser/extensions/api/notification_provider/notification_provider_api.cc12
-rw-r--r--chrome/browser/extensions/api/omnibox/omnibox_api.cc14
-rw-r--r--chrome/browser/extensions/api/passwords_private/passwords_private_event_router.cc6
-rw-r--r--chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc36
-rw-r--r--chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h15
-rw-r--r--chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router.cc2
-rw-r--r--chrome/browser/extensions/api/sessions/sessions_api.cc5
-rw-r--r--chrome/browser/extensions/api/settings_private/settings_private_event_router.cc4
-rw-r--r--chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.cc4
-rw-r--r--chrome/browser/extensions/api/streams_private/streams_private_api.cc7
-rw-r--r--chrome/browser/extensions/api/streams_private/streams_private_apitest.cc8
-rw-r--r--chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc2
-rw-r--r--chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc5
-rw-r--r--chrome/browser/extensions/api/tabs/tabs_event_router.cc72
-rw-r--r--chrome/browser/extensions/api/tabs/tabs_event_router.h5
-rw-r--r--chrome/browser/extensions/api/tabs/windows_event_router.cc20
-rw-r--r--chrome/browser/extensions/api/tabs/windows_event_router.h4
-rw-r--r--chrome/browser/extensions/api/terminal/terminal_private_api.cc2
-rw-r--r--chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc2
-rw-r--r--extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc28
-rw-r--r--extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h2
-rw-r--r--extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc16
-rw-r--r--extensions/browser/api/cast_channel/cast_channel_api.cc8
-rw-r--r--extensions/browser/api/idle/idle_manager.cc5
-rw-r--r--extensions/browser/api/networking_config/networking_config_service.cc20
-rw-r--r--extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc8
-rw-r--r--extensions/browser/api/networking_private/networking_private_event_router_nonchromeos.cc16
-rw-r--r--extensions/browser/api/printer_provider/printer_provider_api.cc13
-rw-r--r--extensions/browser/api/runtime/runtime_api.cc24
-rw-r--r--extensions/browser/api/serial/serial_event_dispatcher.cc4
-rw-r--r--extensions/browser/api/sockets_tcp/tcp_socket_event_dispatcher.cc10
-rw-r--r--extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc4
-rw-r--r--extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc10
-rw-r--r--extensions/browser/api/storage/storage_frontend.cc2
-rw-r--r--extensions/browser/api/usb/usb_event_router.cc6
-rw-r--r--extensions/browser/extension_event_histogram_value.h4
-rw-r--r--tools/metrics/histograms/histograms.xml4
42 files changed, 223 insertions, 213 deletions
diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc
index cbb1844..9dd1358 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -232,7 +232,7 @@ void IdentityAPI::OnAccountSignInChanged(const gaia::AccountIds& ids,
scoped_ptr<base::ListValue> args =
api::identity::OnSignInChanged::Create(account_info, is_signed_in);
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::IDENTITY_ON_SIGN_IN_CHANGED,
api::identity::OnSignInChanged::kEventName,
args.Pass(), browser_context_));
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc
index ec972e0..8382833 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc
@@ -89,8 +89,8 @@ void WebAuthFlow::Start() {
args->AppendString("silent");
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, identity_private::OnWebFlowRequest::kEventName,
- args.Pass()));
+ new Event(events::IDENTITY_PRIVATE_ON_WEB_FLOW_REQUEST,
+ identity_private::OnWebFlowRequest::kEventName, args.Pass()));
event->restrict_to_browser_context = profile_;
ExtensionSystem* system = ExtensionSystem::Get(profile_);
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
index 105c977..3d888b8 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
+++ b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
@@ -161,8 +161,8 @@ void OperationManager::OnProgress(const ExtensionId& extension_id,
scoped_ptr<base::ListValue> args(
image_writer_api::OnWriteProgress::Create(info));
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, image_writer_api::OnWriteProgress::kEventName,
- args.Pass()));
+ new Event(events::IMAGE_WRITER_PRIVATE_ON_WRITE_PROGRESS,
+ image_writer_api::OnWriteProgress::kEventName, args.Pass()));
EventRouter::Get(browser_context_)
->DispatchEventToExtension(extension_id, event.Pass());
@@ -173,8 +173,8 @@ void OperationManager::OnComplete(const ExtensionId& extension_id) {
scoped_ptr<base::ListValue> args(image_writer_api::OnWriteComplete::Create());
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, image_writer_api::OnWriteComplete::kEventName,
- args.Pass()));
+ new Event(events::IMAGE_WRITER_PRIVATE_ON_WRITE_COMPLETE,
+ image_writer_api::OnWriteComplete::kEventName, args.Pass()));
EventRouter::Get(browser_context_)
->DispatchEventToExtension(extension_id, event.Pass());
@@ -196,7 +196,7 @@ void OperationManager::OnError(const ExtensionId& extension_id,
scoped_ptr<base::ListValue> args(
image_writer_api::OnWriteError::Create(info, error_message));
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::IMAGE_WRITER_PRIVATE_ON_WRITE_ERROR,
image_writer_api::OnWriteError::kEventName,
args.Pass()));
diff --git a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
index 13dc7ff..a25bbf9 100644
--- a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
+++ b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
@@ -249,9 +249,9 @@ void LogPrivateAPI::AddEntriesOnUI(scoped_ptr<base::ListValue> value) {
// Create the event's arguments value.
scoped_ptr<base::ListValue> event_args(new base::ListValue());
event_args->Append(value->DeepCopy());
- scoped_ptr<Event> event(new Event(::extensions::events::UNKNOWN,
- ::events::kOnCapturedEvents,
- event_args.Pass()));
+ scoped_ptr<Event> event(
+ new Event(::extensions::events::LOG_PRIVATE_ON_CAPTURED_EVENTS,
+ ::events::kOnCapturedEvents, event_args.Pass()));
EventRouter::Get(browser_context_)
->DispatchEventToExtension(*ix, event.Pass());
}
diff --git a/chrome/browser/extensions/api/mdns/mdns_api.cc b/chrome/browser/extensions/api/mdns/mdns_api.cc
index 53beddc..477b11b 100644
--- a/chrome/browser/extensions/api/mdns/mdns_api.cc
+++ b/chrome/browser/extensions/api/mdns/mdns_api.cc
@@ -172,8 +172,9 @@ void MDnsAPI::OnDnsSdEvent(const std::string& service_type,
}
scoped_ptr<base::ListValue> results = mdns::OnServiceList::Create(args);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, mdns::OnServiceList::kEventName, results.Pass()));
+ scoped_ptr<Event> event(new Event(events::MDNS_ON_SERVICE_LIST,
+ mdns::OnServiceList::kEventName,
+ results.Pass()));
event->restrict_to_browser_context = browser_context_;
event->filter_info.SetServiceType(service_type);
diff --git a/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc b/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc
index c07bfc1..55f62eb 100644
--- a/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc
+++ b/chrome/browser/extensions/api/notification_provider/notification_provider_api.cc
@@ -65,8 +65,8 @@ void NotificationProviderEventRouter::Create(
sender_id, notification_id, options);
scoped_ptr<Event> event(new Event(
- events::UNKNOWN, api::notification_provider::OnCreated::kEventName,
- args.Pass()));
+ events::NOTIFICATION_PROVIDER_ON_CREATED,
+ api::notification_provider::OnCreated::kEventName, args.Pass()));
EventRouter::Get(profile_)
->DispatchEventToExtension(notification_provider_id, event.Pass());
@@ -82,8 +82,8 @@ void NotificationProviderEventRouter::Update(
sender_id, notification_id, options);
scoped_ptr<Event> event(new Event(
- events::UNKNOWN, api::notification_provider::OnUpdated::kEventName,
- args.Pass()));
+ events::NOTIFICATION_PROVIDER_ON_UPDATED,
+ api::notification_provider::OnUpdated::kEventName, args.Pass()));
EventRouter::Get(profile_)
->DispatchEventToExtension(notification_provider_id, event.Pass());
@@ -97,8 +97,8 @@ void NotificationProviderEventRouter::Clear(
api::notification_provider::OnCleared::Create(sender_id, notification_id);
scoped_ptr<Event> event(new Event(
- events::UNKNOWN, api::notification_provider::OnCleared::kEventName,
- args.Pass()));
+ events::NOTIFICATION_PROVIDER_ON_CLEARED,
+ api::notification_provider::OnCleared::kEventName, args.Pass()));
EventRouter::Get(profile_)
->DispatchEventToExtension(notification_provider_id, event.Pass());
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
index e403c87..d232f63 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -99,7 +99,7 @@ std::string GetTemplateURLStringForExtension(const std::string& extension_id) {
// static
void ExtensionOmniboxEventRouter::OnInputStarted(
Profile* profile, const std::string& extension_id) {
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::OMNIBOX_ON_INPUT_STARTED,
omnibox::OnInputStarted::kEventName,
make_scoped_ptr(new base::ListValue())));
event->restrict_to_browser_context = profile;
@@ -120,8 +120,9 @@ bool ExtensionOmniboxEventRouter::OnInputChanged(
args->Set(0, new base::StringValue(input));
args->Set(1, new base::FundamentalValue(suggest_id));
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, omnibox::OnInputChanged::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::OMNIBOX_ON_INPUT_CHANGED,
+ omnibox::OnInputChanged::kEventName,
+ args.Pass()));
event->restrict_to_browser_context = profile;
event_router->DispatchEventToExtension(extension_id, event.Pass());
return true;
@@ -152,8 +153,9 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
else
args->Set(1, new base::StringValue(kCurrentTabDisposition));
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, omnibox::OnInputEntered::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::OMNIBOX_ON_INPUT_ENTERED,
+ omnibox::OnInputEntered::kEventName,
+ args.Pass()));
event->restrict_to_browser_context = profile;
EventRouter::Get(profile)
->DispatchEventToExtension(extension_id, event.Pass());
@@ -167,7 +169,7 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
// static
void ExtensionOmniboxEventRouter::OnInputCancelled(
Profile* profile, const std::string& extension_id) {
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::OMNIBOX_ON_INPUT_CANCELLED,
omnibox::OnInputCancelled::kEventName,
make_scoped_ptr(new base::ListValue())));
event->restrict_to_browser_context = profile;
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.cc
index c37eadb..550fc02 100644
--- a/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.cc
+++ b/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.cc
@@ -81,7 +81,7 @@ void PasswordsPrivateEventRouter::SendSavedPasswordListToListeners() {
return;
scoped_ptr<Event> extension_event(
- new Event(events::UNKNOWN,
+ new Event(events::PASSWORDS_PRIVATE_ON_SAVED_PASSWORDS_LIST_CHANGED,
api::passwords_private::OnSavedPasswordsListChanged::kEventName,
cached_saved_password_parameters_->CreateDeepCopy()));
event_router_->BroadcastEvent(extension_event.Pass());
@@ -101,7 +101,7 @@ void PasswordsPrivateEventRouter::SendPasswordExceptionListToListeners() {
return;
scoped_ptr<Event> extension_event(new Event(
- events::UNKNOWN,
+ events::PASSWORDS_PRIVATE_ON_PASSWORD_EXCEPTIONS_LIST_CHANGED,
api::passwords_private::OnPasswordExceptionsListChanged::kEventName,
cached_password_exception_parameters_->CreateDeepCopy()));
event_router_->BroadcastEvent(extension_event.Pass());
@@ -120,7 +120,7 @@ void PasswordsPrivateEventRouter::OnPlaintextPasswordFetched(
event_value->Append(params.ToValue());
scoped_ptr<Event> extension_event(new Event(
- events::UNKNOWN,
+ events::PASSWORDS_PRIVATE_ON_PLAINTEXT_PASSWORD_RETRIEVED,
api::passwords_private::OnPlaintextPasswordRetrieved::kEventName,
event_value.Pass()));
event_router_->BroadcastEvent(extension_event.Pass());
diff --git a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
index bc58952..f93b1ef 100644
--- a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
+++ b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc
@@ -15,10 +15,10 @@
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/event_router.h"
-namespace screenlock = extensions::api::screenlock_private;
-
namespace extensions {
+namespace screenlock = api::screenlock_private;
+
namespace {
screenlock::AuthType FromLockHandlerAuthType(
@@ -114,14 +114,16 @@ ScreenlockPrivateEventRouter::~ScreenlockPrivateEventRouter() {}
void ScreenlockPrivateEventRouter::OnScreenDidLock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) {
- DispatchEvent(screenlock::OnChanged::kEventName,
- new base::FundamentalValue(true));
+ DispatchEvent(events::SCREENLOCK_PRIVATE_ON_CHANGED,
+ screenlock::OnChanged::kEventName,
+ new base::FundamentalValue(true));
}
void ScreenlockPrivateEventRouter::OnScreenDidUnlock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) {
- DispatchEvent(screenlock::OnChanged::kEventName,
- new base::FundamentalValue(false));
+ DispatchEvent(events::SCREENLOCK_PRIVATE_ON_CHANGED,
+ screenlock::OnChanged::kEventName,
+ new base::FundamentalValue(false));
}
void ScreenlockPrivateEventRouter::OnFocusedUserChanged(
@@ -129,21 +131,22 @@ void ScreenlockPrivateEventRouter::OnFocusedUserChanged(
}
void ScreenlockPrivateEventRouter::DispatchEvent(
+ events::HistogramValue histogram_value,
const std::string& event_name,
base::Value* arg) {
scoped_ptr<base::ListValue> args(new base::ListValue());
if (arg)
args->Append(arg);
- scoped_ptr<extensions::Event> event(new extensions::Event(
- extensions::events::UNKNOWN, event_name, args.Pass()));
- extensions::EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
+ scoped_ptr<Event> event(new Event(histogram_value, event_name, args.Pass()));
+ EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
}
-static base::LazyInstance<extensions::BrowserContextKeyedAPIFactory<
- ScreenlockPrivateEventRouter> > g_factory = LAZY_INSTANCE_INITIALIZER;
+static base::LazyInstance<
+ BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>> g_factory =
+ LAZY_INSTANCE_INITIALIZER;
// static
-extensions::BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>*
+BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>*
ScreenlockPrivateEventRouter::GetFactoryInstance() {
return g_factory.Pointer();
}
@@ -155,8 +158,7 @@ void ScreenlockPrivateEventRouter::Shutdown() {
bool ScreenlockPrivateEventRouter::OnAuthAttempted(
proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type,
const std::string& value) {
- extensions::EventRouter* router =
- extensions::EventRouter::Get(browser_context_);
+ EventRouter* router = EventRouter::Get(browser_context_);
if (!router->HasEventListener(screenlock::OnAuthAttempted::kEventName))
return false;
@@ -164,9 +166,9 @@ bool ScreenlockPrivateEventRouter::OnAuthAttempted(
args->AppendString(screenlock::ToString(FromLockHandlerAuthType(auth_type)));
args->AppendString(value);
- scoped_ptr<extensions::Event> event(new extensions::Event(
- extensions::events::UNKNOWN, screenlock::OnAuthAttempted::kEventName,
- args.Pass()));
+ scoped_ptr<Event> event(
+ new Event(events::SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED,
+ screenlock::OnAuthAttempted::kEventName, args.Pass()));
router->BroadcastEvent(event.Pass());
return true;
}
diff --git a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h
index d120c46..7e284b0 100644
--- a/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h
+++ b/chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h
@@ -10,6 +10,7 @@
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "components/proximity_auth/screenlock_bridge.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
+#include "extensions/browser/extension_event_histogram_value.h"
namespace extensions {
@@ -51,7 +52,7 @@ class ScreenlockPrivateAcceptAuthAttemptFunction
};
class ScreenlockPrivateEventRouter
- : public extensions::BrowserContextKeyedAPI,
+ : public BrowserContextKeyedAPI,
public proximity_auth::ScreenlockBridge::Observer {
public:
explicit ScreenlockPrivateEventRouter(content::BrowserContext* context);
@@ -62,9 +63,8 @@ class ScreenlockPrivateEventRouter
const std::string& value);
// BrowserContextKeyedAPI
- static extensions::BrowserContextKeyedAPIFactory<
- ScreenlockPrivateEventRouter>*
- GetFactoryInstance();
+ static BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>*
+ GetFactoryInstance();
void Shutdown() override;
// proximity_auth::ScreenlockBridge::Observer
@@ -76,8 +76,7 @@ class ScreenlockPrivateEventRouter
void OnFocusedUserChanged(const std::string& user_id) override;
private:
- friend class extensions::BrowserContextKeyedAPIFactory<
- ScreenlockPrivateEventRouter>;
+ friend class BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>;
// BrowserContextKeyedAPI
static const char* service_name() {
@@ -86,7 +85,9 @@ class ScreenlockPrivateEventRouter
static const bool kServiceIsNULLWhileTesting = true;
static const bool kServiceRedirectedInIncognito = true;
- void DispatchEvent(const std::string& event_name, base::Value* arg);
+ void DispatchEvent(events::HistogramValue histogram_value,
+ const std::string& event_name,
+ base::Value* arg);
content::BrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter);
diff --git a/chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router.cc b/chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router.cc
index 769d699..4fb8ecb 100644
--- a/chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router.cc
+++ b/chrome/browser/extensions/api/search_engines_private/search_engines_private_event_router.cc
@@ -100,7 +100,7 @@ void SearchEnginesPrivateEventRouter::OnTemplateURLServiceChanged() {
scoped_ptr<base::ListValue> args(
search_engines_private::OnSearchEnginesChanged::Create(engines));
scoped_ptr<Event> extension_event(new Event(
- events::UNKNOWN,
+ events::SEARCH_ENGINES_PRIVATE_ON_SEARCH_ENGINES_CHANGED,
search_engines_private::OnSearchEnginesChanged::kEventName, args.Pass()));
EventRouter::Get(context_)->BroadcastEvent(extension_event.Pass());
}
diff --git a/chrome/browser/extensions/api/sessions/sessions_api.cc b/chrome/browser/extensions/api/sessions/sessions_api.cc
index e453f32..f98aca0 100644
--- a/chrome/browser/extensions/api/sessions/sessions_api.cc
+++ b/chrome/browser/extensions/api/sessions/sessions_api.cc
@@ -619,8 +619,9 @@ SessionsEventRouter::~SessionsEventRouter() {
void SessionsEventRouter::TabRestoreServiceChanged(
TabRestoreService* service) {
scoped_ptr<base::ListValue> args(new base::ListValue());
- EventRouter::Get(profile_)->BroadcastEvent(make_scoped_ptr(new Event(
- events::UNKNOWN, api::sessions::OnChanged::kEventName, args.Pass())));
+ EventRouter::Get(profile_)->BroadcastEvent(make_scoped_ptr(
+ new Event(events::SESSIONS_ON_CHANGED,
+ api::sessions::OnChanged::kEventName, args.Pass())));
}
void SessionsEventRouter::TabRestoreServiceDestroyed(
diff --git a/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc b/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc
index 153dd3f..6a9582e 100644
--- a/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc
+++ b/chrome/browser/extensions/api/settings_private/settings_private_event_router.cc
@@ -139,8 +139,8 @@ void SettingsPrivateEventRouter::OnPreferenceChanged(
api::settings_private::OnPrefsChanged::Create(prefs));
scoped_ptr<Event> extension_event(new Event(
- events::UNKNOWN, api::settings_private::OnPrefsChanged::kEventName,
- args.Pass()));
+ events::SETTINGS_PRIVATE_ON_PREFS_CHANGED,
+ api::settings_private::OnPrefsChanged::kEventName, args.Pass()));
event_router->BroadcastEvent(extension_event.Pass());
}
diff --git a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.cc b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.cc
index 6cd0f0a..39160c2 100644
--- a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.cc
+++ b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.cc
@@ -78,8 +78,8 @@ void SignedInDevicesChangeObserver::OnDeviceInfoChange() {
scoped_ptr<base::ListValue> result =
api::signed_in_devices::OnDeviceInfoChange::Create(args);
scoped_ptr<Event> event(new Event(
- events::UNKNOWN, api::signed_in_devices::OnDeviceInfoChange::kEventName,
- result.Pass()));
+ events::SIGNED_IN_DEVICES_ON_DEVICE_INFO_CHANGE,
+ api::signed_in_devices::OnDeviceInfoChange::kEventName, result.Pass()));
event->restrict_to_browser_context = profile_;
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_api.cc b/chrome/browser/extensions/api/streams_private/streams_private_api.cc
index 57ebe6d..9b23daa 100644
--- a/chrome/browser/extensions/api/streams_private/streams_private_api.cc
+++ b/chrome/browser/extensions/api/streams_private/streams_private_api.cc
@@ -110,9 +110,10 @@ void StreamsPrivateAPI::ExecuteMimeTypeHandler(
CreateResponseHeadersDictionary(stream->response_headers.get(),
&info.response_headers.additional_properties);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, streams_private::OnExecuteMimeTypeHandler::kEventName,
- streams_private::OnExecuteMimeTypeHandler::Create(info)));
+ scoped_ptr<Event> event(
+ new Event(events::STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER,
+ streams_private::OnExecuteMimeTypeHandler::kEventName,
+ streams_private::OnExecuteMimeTypeHandler::Create(info)));
EventRouter::Get(browser_context_)
->DispatchEventToExtension(extension_id, event.Pass());
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
index 4cacfcf..e34f6fc 100644
--- a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
+++ b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
@@ -180,10 +180,10 @@ class StreamsPrivateApiTest : public ExtensionApiTest {
info.tab_id = 10;
info.expected_content_size = 20;
- scoped_ptr<Event> event(
- new Event(extensions::events::UNKNOWN,
- streams_private::OnExecuteMimeTypeHandler::kEventName,
- streams_private::OnExecuteMimeTypeHandler::Create(info)));
+ scoped_ptr<Event> event(new Event(
+ extensions::events::STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER,
+ streams_private::OnExecuteMimeTypeHandler::kEventName,
+ streams_private::OnExecuteMimeTypeHandler::Create(info)));
extensions::EventRouter::Get(browser()->profile())
->DispatchEventToExtension(test_extension_id_, event.Pass());
diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc
index 35d6afd..07cc8c0 100644
--- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc
+++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc
@@ -82,7 +82,7 @@ void ExtensionIndicatorIcon::OnStatusIconClicked() {
api::system_indicator::OnClicked::Create());
EventRouter* event_router = EventRouter::Get(profile_);
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::SYSTEM_INDICATOR_ON_CLICKED,
system_indicator::OnClicked::kEventName,
params.Pass(), profile_));
event_router->DispatchEventToExtension(
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
index 5543d8b..866f6ce 100644
--- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
+++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
@@ -313,8 +313,9 @@ void TabCaptureRegistry::DispatchStatusChangeEvent(
tab_capture::CaptureInfo info;
request->GetCaptureInfo(&info);
args->Append(info.ToValue().release());
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, tab_capture::OnStatusChanged::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::TAB_CAPTURE_ON_STATUS_CHANGED,
+ tab_capture::OnStatusChanged::kEventName,
+ args.Pass()));
event->restrict_to_browser_context = browser_context_;
router->DispatchEventToExtension(request->extension_id(), event.Pass());
diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.cc b/chrome/browser/extensions/api/tabs/tabs_event_router.cc
index abf5243..c2bc47d 100644
--- a/chrome/browser/extensions/api/tabs/tabs_event_router.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_event_router.cc
@@ -222,8 +222,8 @@ void TabsEventRouter::TabCreatedAt(WebContents* contents,
bool active) {
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
scoped_ptr<base::ListValue> args(new base::ListValue);
- scoped_ptr<Event> event(
- new Event(events::UNKNOWN, tabs::OnCreated::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::TABS_ON_CREATED,
+ tabs::OnCreated::kEventName, args.Pass()));
event->restrict_to_browser_context = profile;
event->user_gesture = EventRouter::USER_GESTURE_NOT_ENABLED;
event->will_dispatch_callback =
@@ -257,8 +257,8 @@ void TabsEventRouter::TabInsertedAt(WebContents* contents,
args->Append(object_args);
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
- DispatchEvent(profile, tabs::OnAttached::kEventName, args.Pass(),
- EventRouter::USER_GESTURE_UNKNOWN);
+ DispatchEvent(profile, events::TABS_ON_ATTACHED, tabs::OnAttached::kEventName,
+ args.Pass(), EventRouter::USER_GESTURE_UNKNOWN);
}
void TabsEventRouter::TabDetachedAt(WebContents* contents, int index) {
@@ -280,10 +280,8 @@ void TabsEventRouter::TabDetachedAt(WebContents* contents, int index) {
args->Append(object_args);
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
- DispatchEvent(profile,
- tabs::OnDetached::kEventName,
- args.Pass(),
- EventRouter::USER_GESTURE_UNKNOWN);
+ DispatchEvent(profile, events::TABS_ON_DETACHED, tabs::OnDetached::kEventName,
+ args.Pass(), EventRouter::USER_GESTURE_UNKNOWN);
}
void TabsEventRouter::TabClosingAt(TabStripModel* tab_strip_model,
@@ -302,10 +300,8 @@ void TabsEventRouter::TabClosingAt(TabStripModel* tab_strip_model,
args->Append(object_args);
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
- DispatchEvent(profile,
- tabs::OnRemoved::kEventName,
- args.Pass(),
- EventRouter::USER_GESTURE_UNKNOWN);
+ DispatchEvent(profile, events::TABS_ON_REMOVED, tabs::OnRemoved::kEventName,
+ args.Pass(), EventRouter::USER_GESTURE_UNKNOWN);
int removed_count = tab_entries_.erase(tab_id);
DCHECK_GT(removed_count, 0);
@@ -335,20 +331,19 @@ void TabsEventRouter::ActiveTabChanged(WebContents* old_contents,
reason & CHANGE_REASON_USER_GESTURE
? EventRouter::USER_GESTURE_ENABLED
: EventRouter::USER_GESTURE_NOT_ENABLED;
- DispatchEvent(profile,
+ DispatchEvent(profile, events::TABS_ON_SELECTION_CHANGED,
tabs::OnSelectionChanged::kEventName,
- scoped_ptr<base::ListValue>(args->DeepCopy()),
- gesture);
- DispatchEvent(profile,
+ scoped_ptr<base::ListValue>(args->DeepCopy()), gesture);
+ DispatchEvent(profile, events::TABS_ON_ACTIVE_CHANGED,
tabs::OnActiveChanged::kEventName,
- scoped_ptr<base::ListValue>(args->DeepCopy()),
- gesture);
+ scoped_ptr<base::ListValue>(args->DeepCopy()), gesture);
// The onActivated event takes one argument: {windowId, tabId}.
args->Remove(0, NULL);
object_args->Set(tabs_constants::kTabIdKey,
new FundamentalValue(tab_id));
- DispatchEvent(profile, tabs::OnActivated::kEventName, args.Pass(), gesture);
+ DispatchEvent(profile, events::TABS_ON_ACTIVATED,
+ tabs::OnActivated::kEventName, args.Pass(), gesture);
}
void TabsEventRouter::TabSelectionChanged(
@@ -380,13 +375,12 @@ void TabsEventRouter::TabSelectionChanged(
// The onHighlighted event replaced onHighlightChanged.
Profile* profile = tab_strip_model->profile();
- DispatchEvent(profile,
+ DispatchEvent(profile, events::TABS_ON_HIGHLIGHT_CHANGED,
tabs::OnHighlightChanged::kEventName,
scoped_ptr<base::ListValue>(args->DeepCopy()),
EventRouter::USER_GESTURE_UNKNOWN);
- DispatchEvent(profile,
- tabs::OnHighlighted::kEventName,
- args.Pass(),
+ DispatchEvent(profile, events::TABS_ON_HIGHLIGHTED,
+ tabs::OnHighlighted::kEventName, args.Pass(),
EventRouter::USER_GESTURE_UNKNOWN);
}
@@ -408,10 +402,8 @@ void TabsEventRouter::TabMoved(WebContents* contents,
args->Append(object_args);
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
- DispatchEvent(profile,
- tabs::OnMoved::kEventName,
- args.Pass(),
- EventRouter::USER_GESTURE_UNKNOWN);
+ DispatchEvent(profile, events::TABS_ON_MOVED, tabs::OnMoved::kEventName,
+ args.Pass(), EventRouter::USER_GESTURE_UNKNOWN);
}
void TabsEventRouter::TabUpdated(
@@ -455,6 +447,7 @@ void TabsEventRouter::FaviconUrlUpdated(WebContents* contents) {
void TabsEventRouter::DispatchEvent(
Profile* profile,
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> args,
EventRouter::UserGestureState user_gesture) {
@@ -462,26 +455,12 @@ void TabsEventRouter::DispatchEvent(
if (!profile_->IsSameProfile(profile) || !event_router)
return;
- scoped_ptr<Event> event(new Event(events::UNKNOWN, event_name, args.Pass()));
+ scoped_ptr<Event> event(new Event(histogram_value, event_name, args.Pass()));
event->restrict_to_browser_context = profile;
event->user_gesture = user_gesture;
event_router->BroadcastEvent(event.Pass());
}
-void TabsEventRouter::DispatchSimpleBrowserEvent(
- Profile* profile, const int window_id, const std::string& event_name) {
- if (!profile_->IsSameProfile(profile))
- return;
-
- scoped_ptr<base::ListValue> args(new base::ListValue);
- args->Append(new FundamentalValue(window_id));
-
- DispatchEvent(profile,
- event_name,
- args.Pass(),
- EventRouter::USER_GESTURE_UNKNOWN);
-}
-
void TabsEventRouter::DispatchTabUpdatedEvent(
WebContents* contents,
scoped_ptr<base::DictionaryValue> changed_properties) {
@@ -504,7 +483,7 @@ void TabsEventRouter::DispatchTabUpdatedEvent(
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
scoped_ptr<Event> event(new Event(
- events::UNKNOWN, tabs::OnUpdated::kEventName, args_base.Pass()));
+ events::TABS_ON_UPDATED, tabs::OnUpdated::kEventName, args_base.Pass()));
event->restrict_to_browser_context = profile;
event->user_gesture = EventRouter::USER_GESTURE_NOT_ENABLED;
event->will_dispatch_callback =
@@ -569,9 +548,8 @@ void TabsEventRouter::TabReplacedAt(TabStripModel* tab_strip_model,
args->Append(new FundamentalValue(old_tab_id));
DispatchEvent(Profile::FromBrowserContext(new_contents->GetBrowserContext()),
- tabs::OnReplaced::kEventName,
- args.Pass(),
- EventRouter::USER_GESTURE_UNKNOWN);
+ events::TABS_ON_REPLACED, tabs::OnReplaced::kEventName,
+ args.Pass(), EventRouter::USER_GESTURE_UNKNOWN);
// Update tab_entries_.
const int removed_count = tab_entries_.erase(old_tab_id);
@@ -617,7 +595,7 @@ void TabsEventRouter::OnZoomChanged(
// Dispatch the |onZoomChange| event.
Profile* profile = Profile::FromBrowserContext(
data.web_contents->GetBrowserContext());
- DispatchEvent(profile,
+ DispatchEvent(profile, events::TABS_ON_ZOOM_CHANGE,
tabs::OnZoomChange::kEventName,
api::tabs::OnZoomChange::Create(zoom_change_info),
EventRouter::USER_GESTURE_UNKNOWN);
diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.h b/chrome/browser/extensions/api/tabs/tabs_event_router.h
index 2273047..1c6a9eb 100644
--- a/chrome/browser/extensions/api/tabs/tabs_event_router.h
+++ b/chrome/browser/extensions/api/tabs/tabs_event_router.h
@@ -106,6 +106,7 @@ class TabsEventRouter : public TabStripModelObserver,
// The TabsEventRouter listens to events for all profiles,
// so we avoid duplication by dropping events destined for other profiles.
void DispatchEvent(Profile* profile,
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> args,
EventRouter::UserGestureState user_gesture);
@@ -116,10 +117,6 @@ class TabsEventRouter : public TabStripModelObserver,
scoped_ptr<base::ListValue> event_args,
scoped_ptr<base::ListValue> cross_incognito_args);
- void DispatchSimpleBrowserEvent(Profile* profile,
- const int window_id,
- const std::string& event_name);
-
// Packages |changed_properties| as a tab updated event for the tab |contents|
// and dispatches the event to the extension.
void DispatchTabUpdatedEvent(
diff --git a/chrome/browser/extensions/api/tabs/windows_event_router.cc b/chrome/browser/extensions/api/tabs/windows_event_router.cc
index f25f209..0eb9756 100644
--- a/chrome/browser/extensions/api/tabs/windows_event_router.cc
+++ b/chrome/browser/extensions/api/tabs/windows_event_router.cc
@@ -65,8 +65,8 @@ void WindowsEventRouter::OnWindowControllerAdded(
base::DictionaryValue* window_dictionary =
window_controller->CreateWindowValue();
args->Append(window_dictionary);
- DispatchEvent(windows::OnCreated::kEventName, window_controller->profile(),
- args.Pass());
+ DispatchEvent(events::WINDOWS_ON_CREATED, windows::OnCreated::kEventName,
+ window_controller->profile(), args.Pass());
}
void WindowsEventRouter::OnWindowControllerRemoved(
@@ -79,9 +79,8 @@ void WindowsEventRouter::OnWindowControllerRemoved(
int window_id = window_controller->GetWindowId();
scoped_ptr<base::ListValue> args(new base::ListValue());
args->Append(new base::FundamentalValue(window_id));
- DispatchEvent(windows::OnRemoved::kEventName,
- window_controller->profile(),
- args.Pass());
+ DispatchEvent(events::WINDOWS_ON_REMOVED, windows::OnRemoved::kEventName,
+ window_controller->profile(), args.Pass());
}
#if !defined(OS_MACOSX)
@@ -145,7 +144,7 @@ void WindowsEventRouter::OnActiveWindowChanged(
if (!HasEventListener(windows::OnFocusChanged::kEventName))
return;
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::WINDOWS_ON_FOCUS_CHANGED,
windows::OnFocusChanged::kEventName,
make_scoped_ptr(new base::ListValue())));
event->will_dispatch_callback =
@@ -155,10 +154,11 @@ void WindowsEventRouter::OnActiveWindowChanged(
EventRouter::Get(profile_)->BroadcastEvent(event.Pass());
}
-void WindowsEventRouter::DispatchEvent(const std::string& event_name,
- Profile* profile,
- scoped_ptr<base::ListValue> args) {
- scoped_ptr<Event> event(new Event(events::UNKNOWN, event_name, args.Pass()));
+void WindowsEventRouter::DispatchEvent(events::HistogramValue histogram_value,
+ const std::string& event_name,
+ Profile* profile,
+ scoped_ptr<base::ListValue> args) {
+ scoped_ptr<Event> event(new Event(histogram_value, event_name, args.Pass()));
event->restrict_to_browser_context = profile;
EventRouter::Get(profile)->BroadcastEvent(event.Pass());
}
diff --git a/chrome/browser/extensions/api/tabs/windows_event_router.h b/chrome/browser/extensions/api/tabs/windows_event_router.h
index b865482..c9ee0b3 100644
--- a/chrome/browser/extensions/api/tabs/windows_event_router.h
+++ b/chrome/browser/extensions/api/tabs/windows_event_router.h
@@ -12,6 +12,7 @@
#include "chrome/browser/extensions/window_controller_list_observer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_event_histogram_value.h"
#if !defined(OS_MACOSX)
#include "ui/views/focus/widget_focus_manager.h"
@@ -55,7 +56,8 @@ class WindowsEventRouter : public WindowControllerListObserver,
void OnActiveWindowChanged(WindowController* window_controller);
private:
- void DispatchEvent(const std::string& event_name,
+ void DispatchEvent(events::HistogramValue histogram_value,
+ const std::string& event_name,
Profile* profile,
scoped_ptr<base::ListValue> args);
bool HasEventListener(const std::string& event_name);
diff --git a/chrome/browser/extensions/api/terminal/terminal_private_api.cc b/chrome/browser/extensions/api/terminal/terminal_private_api.cc
index ca77af7..49326bc 100644
--- a/chrome/browser/extensions/api/terminal/terminal_private_api.cc
+++ b/chrome/browser/extensions/api/terminal/terminal_private_api.cc
@@ -64,7 +64,7 @@ void NotifyProcessOutput(Profile* profile,
extensions::EventRouter* event_router = extensions::EventRouter::Get(profile);
if (profile && event_router) {
scoped_ptr<extensions::Event> event(new extensions::Event(
- extensions::events::UNKNOWN,
+ extensions::events::TERMINAL_PRIVATE_ON_PROCESS_OUTPUT,
terminal_private::OnProcessOutput::kEventName, args.Pass()));
event_router->DispatchEventToExtension(extension_id, event.Pass());
}
diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc
index e6b7f16..d56ed0c 100644
--- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc
+++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.cc
@@ -92,7 +92,7 @@ void WebrtcAudioPrivateEventService::SignalEvent() {
if (router->ExtensionHasEventListener(extension_id, kEventName) &&
extension->permissions_data()->HasAPIPermission("webrtcAudioPrivate")) {
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, kEventName,
+ new Event(events::WEBRTC_AUDIO_PRIVATE_ON_SINKS_CHANGED, kEventName,
make_scoped_ptr(new base::ListValue()).Pass()));
router->DispatchEventToExtension(extension_id, event.Pass());
}
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
index 6884735..d252f16 100644
--- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
+++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
@@ -866,8 +866,9 @@ void BluetoothLowEnergyEventRouter::GattServiceRemoved(
scoped_ptr<base::ListValue> args =
apibtle::OnServiceRemoved::Create(api_service);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, apibtle::OnServiceRemoved::kEventName, args.Pass()));
+ scoped_ptr<Event> event(
+ new Event(events::BLUETOOTH_LOW_ENERGY_ON_SERVICE_REMOVED,
+ apibtle::OnServiceRemoved::kEventName, args.Pass()));
EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
}
@@ -887,8 +888,9 @@ void BluetoothLowEnergyEventRouter::GattDiscoveryCompleteForService(
scoped_ptr<base::ListValue> args =
apibtle::OnServiceAdded::Create(api_service);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, apibtle::OnServiceAdded::kEventName, args.Pass()));
+ scoped_ptr<Event> event(
+ new Event(events::BLUETOOTH_LOW_ENERGY_ON_SERVICE_ADDED,
+ apibtle::OnServiceAdded::kEventName, args.Pass()));
EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
}
@@ -906,8 +908,8 @@ void BluetoothLowEnergyEventRouter::GattServiceChanged(
PopulateService(service, &api_service);
DispatchEventToExtensionsWithPermission(
- apibtle::OnServiceChanged::kEventName,
- service->GetUUID(),
+ events::BLUETOOTH_LOW_ENERGY_ON_SERVICE_CHANGED,
+ apibtle::OnServiceChanged::kEventName, service->GetUUID(),
"" /* characteristic_id */,
apibtle::OnServiceChanged::Create(api_service));
}
@@ -1014,10 +1016,9 @@ void BluetoothLowEnergyEventRouter::GattCharacteristicValueChanged(
args->Append(apibtle::CharacteristicToValue(&api_characteristic).release());
DispatchEventToExtensionsWithPermission(
- apibtle::OnCharacteristicValueChanged::kEventName,
- service->GetUUID(),
- characteristic->GetIdentifier(),
- args.Pass());
+ events::BLUETOOTH_LOW_ENERGY_ON_CHARACTERISTIC_VALUE_CHANGED,
+ apibtle::OnCharacteristicValueChanged::kEventName, service->GetUUID(),
+ characteristic->GetIdentifier(), args.Pass());
}
void BluetoothLowEnergyEventRouter::GattDescriptorValueChanged(
@@ -1045,9 +1046,9 @@ void BluetoothLowEnergyEventRouter::GattDescriptorValueChanged(
args->Append(apibtle::DescriptorToValue(&api_descriptor).release());
DispatchEventToExtensionsWithPermission(
+ events::BLUETOOTH_LOW_ENERGY_ON_DESCRIPTOR_VALUE_CHANGED,
apibtle::OnDescriptorValueChanged::kEventName,
- characteristic->GetService()->GetUUID(),
- "" /* characteristic_id */,
+ characteristic->GetService()->GetUUID(), "" /* characteristic_id */,
args.Pass());
}
@@ -1116,6 +1117,7 @@ void BluetoothLowEnergyEventRouter::InitializeIdentifierMappings() {
}
void BluetoothLowEnergyEventRouter::DispatchEventToExtensionsWithPermission(
+ events::HistogramValue histogram_value,
const std::string& event_name,
const device::BluetoothUUID& uuid,
const std::string& characteristic_id,
@@ -1161,7 +1163,7 @@ void BluetoothLowEnergyEventRouter::DispatchEventToExtensionsWithPermission(
// Send the event.
scoped_ptr<base::ListValue> args_copy(args->DeepCopy());
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, event_name, args_copy.Pass()));
+ new Event(histogram_value, event_name, args_copy.Pass()));
EventRouter::Get(browser_context_)->DispatchEventToExtension(
extension_id, event.Pass());
}
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
index f265505..a27d36b 100644
--- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
+++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h
@@ -17,6 +17,7 @@
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_gatt_service.h"
+#include "extensions/browser/extension_event_histogram_value.h"
#include "extensions/common/api/bluetooth_low_energy.h"
namespace base {
@@ -286,6 +287,7 @@ class BluetoothLowEnergyEventRouter
// should be the instance ID of the involved characteristic. Otherwise, an
// empty string should be passed.
void DispatchEventToExtensionsWithPermission(
+ events::HistogramValue histogram_value,
const std::string& event_name,
const device::BluetoothUUID& uuid,
const std::string& characteristic_id,
diff --git a/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc b/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc
index 03f0be8..ee8a641 100644
--- a/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc
+++ b/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc
@@ -194,8 +194,9 @@ void BluetoothSocketEventDispatcher::ReceiveCallback(
receive_info.data.assign(io_buffer->data(), io_buffer->data() + bytes_read);
scoped_ptr<base::ListValue> args =
bluetooth_socket::OnReceive::Create(receive_info);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, bluetooth_socket::OnReceive::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::BLUETOOTH_SOCKET_ON_RECEIVE,
+ bluetooth_socket::OnReceive::kEventName,
+ args.Pass()));
PostEvent(params, event.Pass());
// Post a task to delay the read until the socket is available, as
@@ -229,8 +230,8 @@ void BluetoothSocketEventDispatcher::ReceiveErrorCallback(
scoped_ptr<base::ListValue> args =
bluetooth_socket::OnReceiveError::Create(receive_error_info);
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, bluetooth_socket::OnReceiveError::kEventName,
- args.Pass()));
+ new Event(events::BLUETOOTH_SOCKET_ON_RECEIVE_ERROR,
+ bluetooth_socket::OnReceiveError::kEventName, args.Pass()));
PostEvent(params, event.Pass());
// Since we got an error, the socket is now "paused" until the application
@@ -290,8 +291,9 @@ void BluetoothSocketEventDispatcher::AcceptCallback(
accept_info.client_socket_id = client_socket_id;
scoped_ptr<base::ListValue> args =
bluetooth_socket::OnAccept::Create(accept_info);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, bluetooth_socket::OnAccept::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::BLUETOOTH_SOCKET_ON_ACCEPT,
+ bluetooth_socket::OnAccept::kEventName,
+ args.Pass()));
PostEvent(params, event.Pass());
// Post a task to delay the accept until the socket is available, as
@@ -324,7 +326,7 @@ void BluetoothSocketEventDispatcher::AcceptErrorCallback(
accept_error_info.error = MapAcceptErrorReason(error_reason);
scoped_ptr<base::ListValue> args =
bluetooth_socket::OnAcceptError::Create(accept_error_info);
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::BLUETOOTH_SOCKET_ON_ACCEPT_ERROR,
bluetooth_socket::OnAcceptError::kEventName,
args.Pass()));
PostEvent(params, event.Pass());
diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc
index bc7d12f..3ec0b63 100644
--- a/extensions/browser/api/cast_channel/cast_channel_api.cc
+++ b/extensions/browser/api/cast_channel/cast_channel_api.cc
@@ -512,8 +512,8 @@ void CastChannelOpenFunction::CastMessageHandler::OnError(
scoped_ptr<base::ListValue> results =
OnError::Create(channel_info, error_info);
- scoped_ptr<Event> event(
- new Event(events::UNKNOWN, OnError::kEventName, results.Pass()));
+ scoped_ptr<Event> event(new Event(events::CAST_CHANNEL_ON_ERROR,
+ OnError::kEventName, results.Pass()));
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(ui_dispatch_cb_, socket_->owner_extension_id(),
@@ -533,8 +533,8 @@ void CastChannelOpenFunction::CastMessageHandler::OnMessage(
scoped_ptr<base::ListValue> results =
OnMessage::Create(channel_info, message_info);
- scoped_ptr<Event> event(
- new Event(events::UNKNOWN, OnMessage::kEventName, results.Pass()));
+ scoped_ptr<Event> event(new Event(events::CAST_CHANNEL_ON_MESSAGE,
+ OnMessage::kEventName, results.Pass()));
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(ui_dispatch_cb_, socket_->owner_extension_id(),
diff --git a/extensions/browser/api/idle/idle_manager.cc b/extensions/browser/api/idle/idle_manager.cc
index a221436..d4a1ff9 100644
--- a/extensions/browser/api/idle/idle_manager.cc
+++ b/extensions/browser/api/idle/idle_manager.cc
@@ -49,8 +49,9 @@ void DefaultEventDelegate::OnStateChanged(const std::string& extension_id,
ui::IdleState new_state) {
scoped_ptr<base::ListValue> args(new base::ListValue());
args->Append(IdleManager::CreateIdleValue(new_state));
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, idle::OnStateChanged::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::IDLE_ON_STATE_CHANGED,
+ idle::OnStateChanged::kEventName,
+ args.Pass()));
event->restrict_to_browser_context = context_;
EventRouter::Get(context_)
->DispatchEventToExtension(extension_id, event.Pass());
diff --git a/extensions/browser/api/networking_config/networking_config_service.cc b/extensions/browser/api/networking_config/networking_config_service.cc
index 55c90b43..d5d9156 100644
--- a/extensions/browser/api/networking_config/networking_config_service.cc
+++ b/extensions/browser/api/networking_config/networking_config_service.cc
@@ -137,9 +137,8 @@ void NetworkingConfigService::OnGotProperties(
const base::Closure& authentication_callback,
const std::string& service_path,
const base::DictionaryValue& onc_network_config) {
- authentication_result_ =
- extensions::NetworkingConfigService::AuthenticationResult(
- std::string(), guid, extensions::NetworkingConfigService::NOTRY);
+ authentication_result_ = NetworkingConfigService::AuthenticationResult(
+ std::string(), guid, NetworkingConfigService::NOTRY);
authentication_callback_ = authentication_callback;
// Try to extract |bssid| field.
@@ -183,9 +182,8 @@ scoped_ptr<Event> NetworkingConfigService::CreatePortalDetectedEventAndDispatch(
return nullptr;
// Populate the NetworkInfo object.
- extensions::core_api::networking_config::NetworkInfo network_info;
- network_info.type =
- extensions::core_api::networking_config::NETWORK_TYPE_WIFI;
+ core_api::networking_config::NetworkInfo network_info;
+ network_info.type = core_api::networking_config::NETWORK_TYPE_WIFI;
const std::vector<uint8_t>& raw_ssid = network->raw_ssid();
std::string hex_ssid =
base::HexEncode(vector_as_array(&raw_ssid), raw_ssid.size());
@@ -195,12 +193,12 @@ scoped_ptr<Event> NetworkingConfigService::CreatePortalDetectedEventAndDispatch(
if (bssid)
network_info.bssid.reset(new std::string(*bssid));
scoped_ptr<base::ListValue> results =
- extensions::core_api::networking_config::OnCaptivePortalDetected::Create(
+ core_api::networking_config::OnCaptivePortalDetected::Create(
network_info);
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
- extensions::core_api::networking_config::
- OnCaptivePortalDetected::kEventName,
- results.Pass()));
+ scoped_ptr<Event> event(new Event(
+ events::NETWORKING_CONFIG_ON_CAPTIVE_PORTAL_DETECTED,
+ core_api::networking_config::OnCaptivePortalDetected::kEventName,
+ results.Pass()));
return event.Pass();
}
diff --git a/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc b/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc
index 9ecbd9c..2dabfdb 100644
--- a/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc
+++ b/extensions/browser/api/networking_private/networking_private_event_router_chromeos.cc
@@ -170,7 +170,7 @@ void NetworkingPrivateEventRouterImpl::NetworkListChanged() {
scoped_ptr<base::ListValue> args(
core_api::networking_private::OnNetworkListChanged::Create(changes));
scoped_ptr<Event> extension_event(
- new Event(events::UNKNOWN,
+ new Event(events::NETWORKING_PRIVATE_ON_NETWORK_LIST_CHANGED,
core_api::networking_private::OnNetworkListChanged::kEventName,
args.Pass()));
event_router->BroadcastEvent(extension_event.Pass());
@@ -186,7 +186,7 @@ void NetworkingPrivateEventRouterImpl::DeviceListChanged() {
scoped_ptr<base::ListValue> args(
core_api::networking_private::OnDeviceStateListChanged::Create());
scoped_ptr<Event> extension_event(new Event(
- events::UNKNOWN,
+ events::NETWORKING_PRIVATE_ON_DEVICE_STATE_LIST_CHANGED,
core_api::networking_private::OnDeviceStateListChanged::kEventName,
args.Pass()));
event_router->BroadcastEvent(extension_event.Pass());
@@ -206,7 +206,7 @@ void NetworkingPrivateEventRouterImpl::NetworkPropertiesUpdated(
core_api::networking_private::OnNetworksChanged::Create(
std::vector<std::string>(1, network->guid())));
scoped_ptr<Event> extension_event(
- new Event(events::UNKNOWN,
+ new Event(events::NETWORKING_PRIVATE_ON_NETWORKS_CHANGED,
core_api::networking_private::OnNetworksChanged::kEventName,
args.Pass()));
event_router->BroadcastEvent(extension_event.Pass());
@@ -270,7 +270,7 @@ void NetworkingPrivateEventRouterImpl::OnPortalDetectionCompleted(
core_api::networking_private::OnPortalDetectionCompleted::Create(path,
status));
scoped_ptr<Event> extension_event(new Event(
- events::UNKNOWN,
+ events::NETWORKING_PRIVATE_ON_PORTAL_DETECTION_COMPLETED,
core_api::networking_private::OnPortalDetectionCompleted::kEventName,
args.Pass()));
event_router->BroadcastEvent(extension_event.Pass());
diff --git a/extensions/browser/api/networking_private/networking_private_event_router_nonchromeos.cc b/extensions/browser/api/networking_private/networking_private_event_router_nonchromeos.cc
index dd04ea5..252c6a3 100644
--- a/extensions/browser/api/networking_private/networking_private_event_router_nonchromeos.cc
+++ b/extensions/browser/api/networking_private/networking_private_event_router_nonchromeos.cc
@@ -136,10 +136,10 @@ void NetworkingPrivateEventRouterImpl::OnNetworksChangedEvent(
return;
scoped_ptr<base::ListValue> args(
core_api::networking_private::OnNetworksChanged::Create(network_guids));
- scoped_ptr<extensions::Event> netchanged_event(new extensions::Event(
- extensions::events::UNKNOWN,
- core_api::networking_private::OnNetworksChanged::kEventName,
- args.Pass()));
+ scoped_ptr<Event> netchanged_event(
+ new Event(events::NETWORKING_PRIVATE_ON_NETWORKS_CHANGED,
+ core_api::networking_private::OnNetworksChanged::kEventName,
+ args.Pass()));
event_router->BroadcastEvent(netchanged_event.Pass());
}
@@ -151,10 +151,10 @@ void NetworkingPrivateEventRouterImpl::OnNetworkListChangedEvent(
scoped_ptr<base::ListValue> args(
core_api::networking_private::OnNetworkListChanged::Create(
network_guids));
- scoped_ptr<extensions::Event> netlistchanged_event(new extensions::Event(
- extensions::events::UNKNOWN,
- core_api::networking_private::OnNetworkListChanged::kEventName,
- args.Pass()));
+ scoped_ptr<Event> netlistchanged_event(
+ new Event(events::NETWORKING_PRIVATE_ON_NETWORK_LIST_CHANGED,
+ core_api::networking_private::OnNetworkListChanged::kEventName,
+ args.Pass()));
event_router->BroadcastEvent(netlistchanged_event.Pass());
}
diff --git a/extensions/browser/api/printer_provider/printer_provider_api.cc b/extensions/browser/api/printer_provider/printer_provider_api.cc
index 5b8be0f..82e3f31 100644
--- a/extensions/browser/api/printer_provider/printer_provider_api.cc
+++ b/extensions/browser/api/printer_provider/printer_provider_api.cc
@@ -527,7 +527,7 @@ void PrinterProviderAPIImpl::DispatchGetPrintersRequested(
internal_args->AppendInteger(request_id);
scoped_ptr<Event> event(
- new Event(events::UNKNOWN,
+ new Event(events::PRINTER_PROVIDER_ON_GET_PRINTERS_REQUESTED,
core_api::printer_provider::OnGetPrintersRequested::kEventName,
internal_args.Pass()));
// This callback is called synchronously during |BroadcastEvent|, so
@@ -566,7 +566,7 @@ void PrinterProviderAPIImpl::DispatchGetCapabilityRequested(
internal_args->AppendString(internal_printer_id);
scoped_ptr<Event> event(new Event(
- events::UNKNOWN,
+ events::PRINTER_PROVIDER_ON_GET_CAPABILITY_REQUESTED,
core_api::printer_provider::OnGetCapabilityRequested::kEventName,
internal_args.Pass()));
@@ -614,9 +614,10 @@ void PrinterProviderAPIImpl::DispatchPrintRequested(
// custom bindings.
internal_args->AppendInteger(request_id);
internal_args->Append(print_job.ToValue().release());
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, core_api::printer_provider::OnPrintRequested::kEventName,
- internal_args.Pass()));
+ scoped_ptr<Event> event(
+ new Event(events::PRINTER_PROVIDER_ON_PRINT_REQUESTED,
+ core_api::printer_provider::OnPrintRequested::kEventName,
+ internal_args.Pass()));
event_router->DispatchEventToExtension(extension_id, event.Pass());
}
@@ -655,7 +656,7 @@ void PrinterProviderAPIImpl::DispatchGetUsbPrinterInfoRequested(
internal_args->AppendInteger(request_id);
internal_args->Append(usb_device.ToValue().release());
scoped_ptr<Event> event(new Event(
- events::UNKNOWN,
+ events::PRINTER_PROVIDER_ON_GET_USB_PRINTER_INFO_REQUESTED,
core_api::printer_provider::OnGetUsbPrinterInfoRequested::kEventName,
internal_args.Pass()));
event_router->DispatchEventToExtension(extension_id, event.Pass());
diff --git a/extensions/browser/api/runtime/runtime_api.cc b/extensions/browser/api/runtime/runtime_api.cc
index d69d518..1766003 100644
--- a/extensions/browser/api/runtime/runtime_api.cc
+++ b/extensions/browser/api/runtime/runtime_api.cc
@@ -105,8 +105,9 @@ void DispatchOnStartupEventImpl(BrowserContext* browser_context,
}
scoped_ptr<base::ListValue> event_args(new base::ListValue());
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, runtime::OnStartup::kEventName, event_args.Pass()));
+ scoped_ptr<Event> event(new Event(events::RUNTIME_ON_STARTUP,
+ runtime::OnStartup::kEventName,
+ event_args.Pass()));
EventRouter::Get(browser_context)
->DispatchEventToExtension(extension_id, event.Pass());
}
@@ -307,8 +308,9 @@ void RuntimeEventRouter::DispatchOnInstalledEvent(
}
EventRouter* event_router = EventRouter::Get(context);
DCHECK(event_router);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, runtime::OnInstalled::kEventName, event_args.Pass()));
+ scoped_ptr<Event> event(new Event(events::RUNTIME_ON_INSTALLED,
+ runtime::OnInstalled::kEventName,
+ event_args.Pass()));
event_router->DispatchEventWithLazyListener(extension_id, event.Pass());
if (old_version.IsValid()) {
@@ -327,7 +329,7 @@ void RuntimeEventRouter::DispatchOnInstalledEvent(
sm_info->SetString(kInstallReason, kInstallReasonSharedModuleUpdate);
sm_info->SetString(kInstallPreviousVersion, old_version.GetString());
sm_info->SetString(kInstallId, extension_id);
- scoped_ptr<Event> sm_event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> sm_event(new Event(events::RUNTIME_ON_INSTALLED,
runtime::OnInstalled::kEventName,
sm_event_args.Pass()));
event_router->DispatchEventWithLazyListener((*i)->id(),
@@ -350,8 +352,9 @@ void RuntimeEventRouter::DispatchOnUpdateAvailableEvent(
args->Append(manifest->DeepCopy());
EventRouter* event_router = EventRouter::Get(context);
DCHECK(event_router);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, runtime::OnUpdateAvailable::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::RUNTIME_ON_UPDATE_AVAILABLE,
+ runtime::OnUpdateAvailable::kEventName,
+ args.Pass()));
event_router->DispatchEventToExtension(extension_id, event.Pass());
}
@@ -366,8 +369,8 @@ void RuntimeEventRouter::DispatchOnBrowserUpdateAvailableEvent(
EventRouter* event_router = EventRouter::Get(context);
DCHECK(event_router);
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, runtime::OnBrowserUpdateAvailable::kEventName,
- args.Pass()));
+ new Event(events::RUNTIME_ON_BROWSER_UPDATE_AVAILABLE,
+ runtime::OnBrowserUpdateAvailable::kEventName, args.Pass()));
event_router->BroadcastEvent(event.Pass());
}
@@ -381,7 +384,8 @@ void RuntimeEventRouter::DispatchOnRestartRequiredEvent(
return;
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, runtime::OnRestartRequired::kEventName,
+ new Event(events::RUNTIME_ON_RESTART_REQUIRED,
+ runtime::OnRestartRequired::kEventName,
core_api::runtime::OnRestartRequired::Create(reason)));
EventRouter* event_router = EventRouter::Get(context);
DCHECK(event_router);
diff --git a/extensions/browser/api/serial/serial_event_dispatcher.cc b/extensions/browser/api/serial/serial_event_dispatcher.cc
index d755320..cf701fe 100644
--- a/extensions/browser/api/serial/serial_event_dispatcher.cc
+++ b/extensions/browser/api/serial/serial_event_dispatcher.cc
@@ -104,7 +104,7 @@ void SerialEventDispatcher::ReceiveCallback(const ReceiveParams& params,
receive_info.data = data;
scoped_ptr<base::ListValue> args = serial::OnReceive::Create(receive_info);
scoped_ptr<extensions::Event> event(
- new extensions::Event(extensions::events::UNKNOWN,
+ new extensions::Event(extensions::events::SERIAL_ON_RECEIVE,
serial::OnReceive::kEventName, args.Pass()));
PostEvent(params, event.Pass());
}
@@ -116,7 +116,7 @@ void SerialEventDispatcher::ReceiveCallback(const ReceiveParams& params,
scoped_ptr<base::ListValue> args =
serial::OnReceiveError::Create(error_info);
scoped_ptr<extensions::Event> event(
- new extensions::Event(extensions::events::UNKNOWN,
+ new extensions::Event(extensions::events::SERIAL_ON_RECEIVE_ERROR,
serial::OnReceiveError::kEventName, args.Pass()));
PostEvent(params, event.Pass());
if (ShouldPauseOnReceiveError(error)) {
diff --git a/extensions/browser/api/sockets_tcp/tcp_socket_event_dispatcher.cc b/extensions/browser/api/sockets_tcp/tcp_socket_event_dispatcher.cc
index 3a7bcc1..91f655e 100644
--- a/extensions/browser/api/sockets_tcp/tcp_socket_event_dispatcher.cc
+++ b/extensions/browser/api/sockets_tcp/tcp_socket_event_dispatcher.cc
@@ -131,8 +131,9 @@ void TCPSocketEventDispatcher::ReadCallback(
receive_info.data.assign(io_buffer->data(), io_buffer->data() + bytes_read);
scoped_ptr<base::ListValue> args =
sockets_tcp::OnReceive::Create(receive_info);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, sockets_tcp::OnReceive::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::SOCKETS_TCP_ON_RECEIVE,
+ sockets_tcp::OnReceive::kEventName,
+ args.Pass()));
PostEvent(params, event.Pass());
// Post a task to delay the read until the socket is available, as
@@ -152,8 +153,9 @@ void TCPSocketEventDispatcher::ReadCallback(
receive_error_info.result_code = bytes_read;
scoped_ptr<base::ListValue> args =
sockets_tcp::OnReceiveError::Create(receive_error_info);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, sockets_tcp::OnReceiveError::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::SOCKETS_TCP_ON_RECEIVE_ERROR,
+ sockets_tcp::OnReceiveError::kEventName,
+ args.Pass()));
PostEvent(params, event.Pass());
// Since we got an error, the socket is now "paused" until the application
diff --git a/extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc b/extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc
index 5e01c44..a49f825 100644
--- a/extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc
+++ b/extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc
@@ -134,7 +134,7 @@ void TCPServerSocketEventDispatcher::AcceptCallback(
accept_info.client_socket_id = client_socket_id;
scoped_ptr<base::ListValue> args =
sockets_tcp_server::OnAccept::Create(accept_info);
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::SOCKETS_TCP_SERVER_ON_ACCEPT,
sockets_tcp_server::OnAccept::kEventName,
args.Pass()));
PostEvent(params, event.Pass());
@@ -154,7 +154,7 @@ void TCPServerSocketEventDispatcher::AcceptCallback(
scoped_ptr<base::ListValue> args =
sockets_tcp_server::OnAcceptError::Create(accept_error_info);
scoped_ptr<Event> event(
- new Event(events::UNKNOWN,
+ new Event(events::SOCKETS_TCP_SERVER_ON_ACCEPT_ERROR,
sockets_tcp_server::OnAcceptError::kEventName, args.Pass()));
PostEvent(params, event.Pass());
diff --git a/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc b/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc
index 87e7bc2..31b2f59 100644
--- a/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc
+++ b/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc
@@ -116,8 +116,9 @@ void UDPSocketEventDispatcher::ReceiveCallback(
receive_info.remote_port = port;
scoped_ptr<base::ListValue> args =
sockets_udp::OnReceive::Create(receive_info);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, sockets_udp::OnReceive::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::SOCKETS_UDP_ON_RECEIVE,
+ sockets_udp::OnReceive::kEventName,
+ args.Pass()));
PostEvent(params, event.Pass());
// Post a task to delay the read until the socket is available, as
@@ -137,8 +138,9 @@ void UDPSocketEventDispatcher::ReceiveCallback(
receive_error_info.result_code = bytes_read;
scoped_ptr<base::ListValue> args =
sockets_udp::OnReceiveError::Create(receive_error_info);
- scoped_ptr<Event> event(new Event(
- events::UNKNOWN, sockets_udp::OnReceiveError::kEventName, args.Pass()));
+ scoped_ptr<Event> event(new Event(events::SOCKETS_UDP_ON_RECEIVE_ERROR,
+ sockets_udp::OnReceiveError::kEventName,
+ args.Pass()));
PostEvent(params, event.Pass());
// Since we got an error, the socket is now "paused" until the application
diff --git a/extensions/browser/api/storage/storage_frontend.cc b/extensions/browser/api/storage/storage_frontend.cc
index c80439f..269d483 100644
--- a/extensions/browser/api/storage/storage_frontend.cc
+++ b/extensions/browser/api/storage/storage_frontend.cc
@@ -47,7 +47,7 @@ class DefaultObserver : public SettingsObserver {
args->Append(base::JSONReader::Read(change_json));
args->Append(new base::StringValue(settings_namespace::ToString(
settings_namespace)));
- scoped_ptr<Event> event(new Event(events::UNKNOWN,
+ scoped_ptr<Event> event(new Event(events::STORAGE_ON_CHANGED,
core_api::storage::OnChanged::kEventName,
args.Pass()));
EventRouter::Get(browser_context_)
diff --git a/extensions/browser/api/usb/usb_event_router.cc b/extensions/browser/api/usb/usb_event_router.cc
index 895a3b6..97fb87c 100644
--- a/extensions/browser/api/usb/usb_event_router.cc
+++ b/extensions/browser/api/usb/usb_event_router.cc
@@ -106,11 +106,13 @@ void UsbEventRouter::DispatchEvent(const std::string& event_name,
scoped_ptr<Event> event;
if (event_name == usb::OnDeviceAdded::kEventName) {
- event.reset(new Event(events::UNKNOWN, usb::OnDeviceAdded::kEventName,
+ event.reset(new Event(events::USB_ON_DEVICE_ADDED,
+ usb::OnDeviceAdded::kEventName,
usb::OnDeviceAdded::Create(device_obj)));
} else {
DCHECK(event_name == usb::OnDeviceRemoved::kEventName);
- event.reset(new Event(events::UNKNOWN, usb::OnDeviceRemoved::kEventName,
+ event.reset(new Event(events::USB_ON_DEVICE_REMOVED,
+ usb::OnDeviceRemoved::kEventName,
usb::OnDeviceRemoved::Create(device_obj)));
}
diff --git a/extensions/browser/extension_event_histogram_value.h b/extensions/browser/extension_event_histogram_value.h
index c91904c..29e8ea2 100644
--- a/extensions/browser/extension_event_histogram_value.h
+++ b/extensions/browser/extension_event_histogram_value.h
@@ -355,6 +355,10 @@ enum HistogramValue {
LAUNCHER_PAGE_ON_POP_SUBPAGE,
DIAL_ON_DEVICE_LIST,
DIAL_ON_ERROR,
+ CAST_CHANNEL_ON_MESSAGE,
+ CAST_CHANNEL_ON_ERROR,
+ SCREENLOCK_PRIVATE_ON_CHANGED,
+ SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED,
// Last entry: Add new entries above, then run:
// python tools/metrics/histograms/update_extension_histograms.py
ENUM_BOUNDARY
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index f623c4a..969e55a 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -55177,6 +55177,10 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<int value="334" label="LAUNCHER_PAGE_ON_POP_SUBPAGE"/>
<int value="335" label="DIAL_ON_DEVICE_LIST"/>
<int value="336" label="DIAL_ON_ERROR"/>
+ <int value="337" label="CAST_CHANNEL_ON_MESSAGE"/>
+ <int value="338" label="CAST_CHANNEL_ON_ERROR"/>
+ <int value="339" label="SCREENLOCK_PRIVATE_ON_CHANGED"/>
+ <int value="340" label="SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED"/>
</enum>
<enum name="ExtensionFileWriteResult" type="int">