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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 1283243002: Add UMA and Rappor metrics to capture URLs passed in at startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cast 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/ui/startup/startup_browser_creator_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 7daf465e1e645f127adc8e255a8a264e69fbc751..63141cccbc6885456683920aed5ed7cca2670510 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -16,7 +16,7 @@
#include "base/environment.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
-#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_macros.h"
#include "base/metrics/statistics_recorder.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
@@ -79,6 +79,7 @@
#include "chrome/grit/locale_settings.h"
#include "chrome/installer/util/browser_distribution.h"
#include "components/google/core/browser/google_util.h"
+#include "components/rappor/rappor_utils.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/notification_observer.h"
@@ -325,6 +326,10 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
const std::vector<GURL>& urls_to_open,
bool process_startup,
chrome::HostDesktopType desktop_type) {
+ UMA_HISTOGRAM_COUNTS_100("Startup.BrowserLaunchURLCount",
+ static_cast<base::HistogramBase::Sample>(urls_to_open.size()));
+ RecordRapporOnStartupURLs(urls_to_open);
+
DCHECK(profile);
profile_ = profile;
@@ -1015,3 +1020,11 @@ void StartupBrowserCreatorImpl::InitializeWelcomeRunType(
welcome_run_type_ = WelcomeRunType::FIRST_RUN_LAST_TAB;
#endif // !OS_WIN
}
+
+void StartupBrowserCreatorImpl::RecordRapporOnStartupURLs(
+ const std::vector<GURL>& urls_to_open) {
+ for (const GURL& url : urls_to_open) {
+ rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
+ "Startup.BrowserLaunchURL", url);
+ }
+}
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698