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

Unified Diff: extensions/browser/api/system_info/system_info_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: extensions/browser/api/system_info/system_info_api.cc
diff --git a/extensions/browser/api/system_info/system_info_api.cc b/extensions/browser/api/system_info/system_info_api.cc
index a5b85bf801d2c7e752b0089272bfac88c8ba9d82..07d2dbda4ccc5ab15eefb1d8888119b93a52e55b 100644
--- a/extensions/browser/api/system_info/system_info_api.cc
+++ b/extensions/browser/api/system_info/system_info_api.cc
@@ -73,7 +73,8 @@ class SystemInfoEventRouter : public gfx::DisplayObserver,
// Called from any thread to dispatch the systemInfo event to all extension
// processes cross multiple profiles.
- void DispatchEvent(const std::string& event_name,
+ void DispatchEvent(events::HistogramValue histogram_value,
+ const std::string& event_name,
scoped_ptr<base::ListValue> args);
// Called to dispatch the systemInfo.display.onDisplayChanged event.
@@ -164,7 +165,8 @@ void SystemInfoEventRouter::OnRemovableStorageAttached(
systeminfo::BuildStorageUnitInfo(info, &unit);
scoped_ptr<base::ListValue> args(new base::ListValue);
args->Append(unit.ToValue().release());
- DispatchEvent(system_storage::OnAttached::kEventName, args.Pass());
+ DispatchEvent(events::SYSTEM_STORAGE_ON_ATTACHED,
+ system_storage::OnAttached::kEventName, args.Pass());
}
void SystemInfoEventRouter::OnRemovableStorageDetached(
@@ -175,7 +177,8 @@ void SystemInfoEventRouter::OnRemovableStorageDetached(
info.device_id());
args->AppendString(transient_id);
- DispatchEvent(system_storage::OnDetached::kEventName, args.Pass());
+ DispatchEvent(events::SYSTEM_STORAGE_ON_DETACHED,
+ system_storage::OnDetached::kEventName, args.Pass());
}
void SystemInfoEventRouter::OnDisplayAdded(const gfx::Display& new_display) {
@@ -193,13 +196,16 @@ void SystemInfoEventRouter::OnDisplayMetricsChanged(const gfx::Display& display,
void SystemInfoEventRouter::OnDisplayChanged() {
scoped_ptr<base::ListValue> args(new base::ListValue());
- DispatchEvent(system_display::OnDisplayChanged::kEventName, args.Pass());
+ DispatchEvent(events::SYSTEM_DISPLAY_ON_DISPLAY_CHANGED,
+ system_display::OnDisplayChanged::kEventName, args.Pass());
}
-void SystemInfoEventRouter::DispatchEvent(const std::string& event_name,
- scoped_ptr<base::ListValue> args) {
- ExtensionsBrowserClient::Get()->BroadcastEventToRenderers(event_name,
- args.Pass());
+void SystemInfoEventRouter::DispatchEvent(
+ events::HistogramValue histogram_value,
+ const std::string& event_name,
+ scoped_ptr<base::ListValue> args) {
+ ExtensionsBrowserClient::Get()->BroadcastEventToRenderers(
+ histogram_value, event_name, args.Pass());
}
void AddEventListener(const std::string& event_name) {
« no previous file with comments | « extensions/browser/api/management/management_api.cc ('k') | extensions/browser/api/vpn_provider/vpn_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698