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

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

Issue 2798143004: Fix for URL opening code (Closed)
Patch Set: Fixed statistics for no tabs at startup case. Created 3 years, 6 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_browser_main_extra_parts_metrics.cc
diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
index 99e8752bb20b00b2c654c7d017bf5d085d95af8f..c8b161ce065fe59361320c09fd7f7a5abf0bef5a 100644
--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
@@ -21,7 +21,11 @@
#include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/mac/bluetooth_utility.h"
#include "chrome/browser/shell_integration.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/flags_ui/pref_service_flags_storage.h"
+#include "components/startup_metric_utils/browser/startup_metric_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "ui/base/touch/touch_device.h"
@@ -510,7 +514,18 @@ void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() {
is_screen_observer_ = true;
#if !defined(OS_ANDROID)
- metrics::BeginFirstWebContentsProfiling();
+ const BrowserList* browser_list = BrowserList::GetInstance();
+
+ auto first_browser = browser_list->begin();
+ if (first_browser != browser_list->end()) {
+ TabStripModel* tab_strip = (*first_browser)->tab_strip_model();
+ DCHECK(tab_strip);
+ if (tab_strip->empty()) {
+ startup_metric_utils::SetNonBrowserUIDisplayed();
gab 2017/06/13 16:29:34 Add a comment about when this happens
eugenebng 2017/06/14 11:17:46 It was happening when I started this fix. Now I ca
gab 2017/06/14 17:03:23 Ok but I'd say keep a comment referring to this di
eugenebng 2017/06/15 00:31:49 Added comment.
+ } else {
+ metrics::BeginFirstWebContentsProfiling();
+ }
+ }
metrics::TabUsageRecorder::InitializeIfNeeded();
#endif // !defined(OS_ANDROID)
}

Powered by Google App Engine
This is Rietveld 408576698