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
3 // found in the LICENSE file.
5 #include "components/navigation_metrics/navigation_metrics.h"
7 #include "base/metrics/histogram.h"
25 static const char* kSchemeNames
[] = {
38 COMPILE_ASSERT(arraysize(kSchemeNames
) == SCHEME_MAX
+ 1,
39 NavigationMetricsRecorder_name_count_mismatch
);
43 namespace navigation_metrics
{
45 void RecordMainFrameNavigation(const GURL
& url
) {
46 Scheme scheme
= SCHEME_UNKNOWN
;
47 for (int i
= 1; i
< SCHEME_MAX
; ++i
) {
48 if (url
.SchemeIs(kSchemeNames
[i
])) {
49 scheme
= static_cast<Scheme
>(i
);
53 UMA_HISTOGRAM_ENUMERATION(
54 "Navigation.MainFrameScheme", scheme
, SCHEME_MAX
);
57 } // namespace navigation_metrics