| Index: chrome/browser/ui/browser.cc
|
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
| index 1676d6d7feed19f1b6398f9f9f96158efc308d29..ccb133cc8b7958d00f3d02d81f347fee3bd9f868 100644
|
| --- a/chrome/browser/ui/browser.cc
|
| +++ b/chrome/browser/ui/browser.cc
|
| @@ -19,6 +19,7 @@
|
| #include "base/metrics/field_trial.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/path_service.h"
|
| +#include "base/process_info.h"
|
| #include "base/string_number_conversions.h"
|
| #include "base/string_util.h"
|
| #include "base/stringprintf.h"
|
| @@ -152,6 +153,7 @@
|
| #include "chrome/common/extensions/extension_constants.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/profiling.h"
|
| +#include "chrome/common/startup_metric_utils.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "chrome/common/web_apps.h"
|
| #include "content/public/browser/color_chooser.h"
|
| @@ -1195,6 +1197,26 @@ void Browser::OnWindowDidShow() {
|
| return;
|
| window_has_shown_ = true;
|
|
|
| +// CurrentProcessInfo::CreationTime() is currently only implemented on Mac and
|
| +// Windows.
|
| +#if defined(OS_MACOSX) || defined(OS_WIN)
|
| + // Measure the latency from startup till the first browser window becomes
|
| + // visible.
|
| + static bool is_first_browser_window = true;
|
| + if (is_first_browser_window &&
|
| + !startup_metric_utils::WasNonBrowserUIDisplayed()) {
|
| + is_first_browser_window = false;
|
| + const base::Time* process_creation_time =
|
| + base::CurrentProcessInfo::CreationTime();
|
| +
|
| + if (process_creation_time) {
|
| + UMA_HISTOGRAM_LONG_TIMES(
|
| + "Startup.BrowserWindowDisplay",
|
| + base::Time::Now() - *process_creation_time);
|
| + }
|
| + }
|
| +#endif // OS_MACOSX || OS_WIN
|
| +
|
| // Nothing to do for non-tabbed windows.
|
| if (!is_type_tabbed())
|
| return;
|
|
|