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

Unified Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 1282473002: Remove listening of OMNIBOX_OPENED_URL from metrics code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/metrics/chrome_metrics_service_client.cc
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc
index 7087add4ead1e7ff20e43a992778e47a428838e0..f80bad88e2370bb2c5205e5729eacdcd1a74628b 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -588,8 +588,11 @@ void ChromeMetricsServiceClient::RegisterForNotifications() {
content::NotificationService::AllSources());
registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_HANG,
content::NotificationService::AllSources());
- registrar_.Add(this, chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
- content::NotificationService::AllSources());
+
+ omnibox_url_opened_subscription_ =
+ OmniboxEventGlobalTracker::GetInstance()->RegisterCallback(
+ base::Bind(&ChromeMetricsServiceClient::OnURLOpenedFromOmnibox,
+ base::Unretained(this)));
}
void ChromeMetricsServiceClient::Observe(
@@ -601,17 +604,24 @@ void ChromeMetricsServiceClient::Observe(
switch (type) {
case chrome::NOTIFICATION_BROWSER_OPENED:
case chrome::NOTIFICATION_BROWSER_CLOSED:
- case chrome::NOTIFICATION_OMNIBOX_OPENED_URL:
case chrome::NOTIFICATION_TAB_PARENTED:
case chrome::NOTIFICATION_TAB_CLOSING:
case content::NOTIFICATION_LOAD_STOP:
case content::NOTIFICATION_LOAD_START:
case content::NOTIFICATION_RENDERER_PROCESS_CLOSED:
case content::NOTIFICATION_RENDER_WIDGET_HOST_HANG:
- metrics_service_->OnApplicationNotIdle();
+ OnApplicationNotIdle();
break;
default:
NOTREACHED();
}
}
+
+void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) {
+ OnApplicationNotIdle();
+}
+
+void ChromeMetricsServiceClient::OnApplicationNotIdle() {
+ metrics_service_->OnApplicationNotIdle();
Alexei Svitkine (slow) 2015/08/07 14:57:37 Nit: Since its body is a 1-liner, doesn't seem wor
blundell 2015/08/17 09:24:01 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698