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

Side by Side Diff: components/navigation_metrics/navigation_metrics.cc

Issue 2823233003: Deprecate Once-Per-Origin Navigation histograms (Closed)
Patch Set: Remove deleted .h from .mm Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/navigation_metrics/navigation_metrics.h" 5 #include "components/navigation_metrics/navigation_metrics.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1, 45 static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1,
46 "kSchemeNames should have SCHEME_MAX + 1 elements"); 46 "kSchemeNames should have SCHEME_MAX + 1 elements");
47 47
48 } // namespace 48 } // namespace
49 49
50 namespace navigation_metrics { 50 namespace navigation_metrics {
51 51
52 void RecordMainFrameNavigation(const GURL& url, 52 void RecordMainFrameNavigation(const GURL& url,
53 bool is_in_page, 53 bool is_in_page,
54 bool is_off_the_record, 54 bool is_off_the_record) {
55 bool have_already_seen_origin) {
56 Scheme scheme = SCHEME_UNKNOWN; 55 Scheme scheme = SCHEME_UNKNOWN;
57 for (int i = 1; i < SCHEME_MAX; ++i) { 56 for (int i = 1; i < SCHEME_MAX; ++i) {
58 if (url.SchemeIs(kSchemeNames[i])) { 57 if (url.SchemeIs(kSchemeNames[i])) {
59 scheme = static_cast<Scheme>(i); 58 scheme = static_cast<Scheme>(i);
60 break; 59 break;
61 } 60 }
62 } 61 }
63 62
64 if (!have_already_seen_origin) {
65 if (is_off_the_record) {
66 UMA_HISTOGRAM_ENUMERATION("Navigation.SchemePerUniqueOriginOTR", scheme,
67 SCHEME_MAX);
68 } else {
69 UMA_HISTOGRAM_ENUMERATION("Navigation.SchemePerUniqueOrigin", scheme,
70 SCHEME_MAX);
71 }
72 }
73
74 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameScheme", scheme, SCHEME_MAX); 63 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameScheme", scheme, SCHEME_MAX);
75 if (!is_in_page) { 64 if (!is_in_page) {
76 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeDifferentPage", scheme, 65 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeDifferentPage", scheme,
77 SCHEME_MAX); 66 SCHEME_MAX);
78 } 67 }
79 } 68 }
80 69
81 } // namespace navigation_metrics 70 } // namespace navigation_metrics
OLDNEW
« no previous file with comments | « components/navigation_metrics/navigation_metrics.h ('k') | components/navigation_metrics/navigation_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698