Index: chrome/browser/metrics/metrics_service.cc |
=================================================================== |
--- chrome/browser/metrics/metrics_service.cc (revision 271667) |
+++ chrome/browser/metrics/metrics_service.cc (working copy) |
@@ -189,12 +189,12 @@ |
#include "chrome/browser/metrics/metrics_log.h" |
#include "chrome/browser/metrics/metrics_reporting_scheduler.h" |
#include "chrome/browser/metrics/metrics_state_manager.h" |
+#include "chrome/browser/metrics/omnibox_metrics_provider.h" |
#include "chrome/browser/metrics/time_ticks_experiment_win.h" |
#include "chrome/browser/metrics/tracking_synchronizer.h" |
#include "chrome/common/metrics/variations/variations_util.h" |
#include "chrome/browser/net/http_pipelining_compatibility_client.h" |
#include "chrome/browser/net/network_stats.h" |
-#include "chrome/browser/omnibox/omnibox_log.h" |
#include "chrome/browser/ui/browser_otr_state.h" |
#include "chrome/common/chrome_constants.h" |
#include "chrome/common/chrome_switches.h" |
@@ -477,6 +477,10 @@ |
DCHECK(IsSingleThreaded()); |
DCHECK(state_manager_); |
+ // TODO(asvitkine): Move this out of MetricsService. |
+ RegisterMetricsProvider( |
+ scoped_ptr<metrics::MetricsProvider>(new OmniboxMetricsProvider)); |
+ |
BrowserChildProcessObserver::Add(this); |
} |
@@ -647,6 +651,7 @@ |
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: |
@@ -682,29 +687,10 @@ |
break; |
default: |
- // Everything else is handled after the early return check below. |
+ NOTREACHED(); |
break; |
} |
- // If it wasn't one of the stability-related notifications, and event |
- // logging isn't suppressed, handle it. |
- if (!handled && ShouldLogEvents()) { |
- switch (type) { |
- case chrome::NOTIFICATION_OMNIBOX_OPENED_URL: { |
- MetricsLog* current_log = |
- static_cast<MetricsLog*>(log_manager_.current_log()); |
- DCHECK(current_log); |
- current_log->RecordOmniboxOpenedURL( |
- *content::Details<OmniboxLog>(details).ptr()); |
- break; |
- } |
- |
- default: |
- NOTREACHED(); |
- break; |
- } |
- } |
- |
HandleIdleSinceLastTransmission(false); |
} |