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

Unified Diff: components/navigation_metrics/navigation_metrics.cc

Issue 1844753002: Histogram the scheme of an origin on the 1st navigation to it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: components/navigation_metrics/navigation_metrics.cc
diff --git a/components/navigation_metrics/navigation_metrics.cc b/components/navigation_metrics/navigation_metrics.cc
index e0d61c769f7b6a5daa6c876951b4870d02babf58..69a2403aa467e131f815b530ecba85fba4951426 100644
--- a/components/navigation_metrics/navigation_metrics.cc
+++ b/components/navigation_metrics/navigation_metrics.cc
@@ -47,7 +47,9 @@ static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1,
namespace navigation_metrics {
-void RecordMainFrameNavigation(const GURL& url, bool is_in_page) {
+void RecordMainFrameNavigation(const GURL& url,
+ bool is_in_page,
+ bool is_off_the_record) {
Scheme scheme = SCHEME_UNKNOWN;
for (int i = 1; i < SCHEME_MAX; ++i) {
if (url.SchemeIs(kSchemeNames[i])) {
@@ -55,11 +57,16 @@ void RecordMainFrameNavigation(const GURL& url, bool is_in_page) {
break;
}
}
- UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameScheme", scheme, SCHEME_MAX);
- if (!is_in_page) {
- UMA_HISTOGRAM_ENUMERATION(
- "Navigation.MainFrameSchemeDifferentPage", scheme, SCHEME_MAX);
+
+ const char* enumeration_mfs = "Navigation.MainFrameScheme";
+ const char* enumeration_mfs_dp = "Navigation.MainFrameSchemeDifferentPage";
+ if (is_off_the_record) {
+ enumeration_mfs = "Navigation.IncognitoMainFrameScheme";
+ enumeration_mfs_dp = "Navigation.IncognitoMainFrameSchemeDifferentPage";
}
+ UMA_HISTOGRAM_ENUMERATION(enumeration_mfs, scheme, SCHEME_MAX);
felt 2016/04/01 00:01:59 Does this actually work? I thought the histogram m
palmer 2016/04/05 23:42:18 It compiles and runs, but the comments about lazy
+ if (!is_in_page)
+ UMA_HISTOGRAM_ENUMERATION(enumeration_mfs_dp, scheme, SCHEME_MAX);
}
} // namespace navigation_metrics

Powered by Google App Engine
This is Rietveld 408576698