diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-21 21:29:12 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-21 21:29:12 +0000 |
commit | 6d65a46ab8dff07d44aea625222587e09aae06ca (patch) | |
tree | 68d59bf622916f4a487308e3fbfa82224699e486 /chrome/browser/ui/webui/metrics_handler.cc | |
parent | e52291df4e21fb9857f7225b86ca50fbcb8cc583 (diff) | |
download | chromium_src-6d65a46ab8dff07d44aea625222587e09aae06ca.zip chromium_src-6d65a46ab8dff07d44aea625222587e09aae06ca.tar.gz chromium_src-6d65a46ab8dff07d44aea625222587e09aae06ca.tar.bz2 |
Move histograms and supporting code that don't belong in content out.
This CL was originally based on top of r205149 (Fast Tab Closure) and committed as r207181. The Fast Tab Closure CL was backed out together with the previous version of this CL.
Here's another shot, doing the same cleanup as before but with r205149 reverted.
BUG=
Review URL: https://chromiumcodereview.appspot.com/17153008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/metrics_handler.cc')
-rw-r--r-- | chrome/browser/ui/webui/metrics_handler.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/ui/webui/metrics_handler.cc b/chrome/browser/ui/webui/metrics_handler.cc index b57ce0f..9394e07 100644 --- a/chrome/browser/ui/webui/metrics_handler.cc +++ b/chrome/browser/ui/webui/metrics_handler.cc @@ -11,6 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/metrics/metric_event_duration_details.h" +#include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/common/chrome_notification_types.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/user_metrics.h" @@ -82,10 +83,12 @@ void MetricsHandler::HandleLogEventTime(const ListValue* args) { // Not all new tab pages get timed. In those cases, we don't have a // new_tab_start_time_. - if (tab->GetNewTabStartTime().is_null()) + CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(tab); + if (core_tab_helper->new_tab_start_time().is_null()) return; - base::TimeDelta duration = base::TimeTicks::Now() - tab->GetNewTabStartTime(); + base::TimeDelta duration = + base::TimeTicks::Now() - core_tab_helper->new_tab_start_time(); MetricEventDurationDetails details(event_name, static_cast<int>(duration.InMilliseconds())); @@ -96,7 +99,8 @@ void MetricsHandler::HandleLogEventTime(const ListValue* args) { } else if (event_name == "Tab.NewTabOnload") { UMA_HISTOGRAM_TIMES("Tab.NewTabOnload", duration); // The new tab page has finished loading; reset it. - tab->SetNewTabStartTime(base::TimeTicks()); + CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(tab); + core_tab_helper->set_new_tab_start_time(base::TimeTicks()); } else { NOTREACHED(); } |