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

Unified Diff: chrome/browser/metrics/thread_watcher.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: Response to review 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
« no previous file with comments | « chrome/browser/metrics/thread_watcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/thread_watcher.cc
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc
index 0f9e9acdca01058eda882f56fb5f7a7be549a0fd..6c9a93e83394ce6146aaf4f8c494644682871888 100644
--- a/chrome/browser/metrics/thread_watcher.cc
+++ b/chrome/browser/metrics/thread_watcher.cc
@@ -688,9 +688,10 @@ void ThreadWatcherObserver::SetupNotifications(
observer->registrar_.Add(observer,
content::NOTIFICATION_RENDER_WIDGET_HOST_HANG,
content::NotificationService::AllSources());
- observer->registrar_.Add(observer,
- chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
- content::NotificationService::AllSources());
+ observer->omnibox_url_opened_subscription_ =
+ OmniboxEventGlobalTracker::GetInstance()->RegisterCallback(
+ base::Bind(&ThreadWatcherObserver::OnURLOpenedFromOmnibox,
+ base::Unretained(observer)));
}
// static
@@ -706,6 +707,14 @@ void ThreadWatcherObserver::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
+ OnUserActivityDetected();
+}
+
+void ThreadWatcherObserver::OnURLOpenedFromOmnibox(OmniboxLog* log) {
+ OnUserActivityDetected();
+}
+
+void ThreadWatcherObserver::OnUserActivityDetected() {
// There is some user activity, see if thread watchers are to be awakened.
base::TimeTicks now = base::TimeTicks::Now();
if ((now - last_wakeup_time_) < wakeup_interval_)
« no previous file with comments | « chrome/browser/metrics/thread_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698