OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 5 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/tab_contents/origins_seen_service_factory.h" | 10 #include "chrome/browser/tab_contents/origins_seen_service_factory.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const url::Origin origin(details.entry->GetVirtualURL()); | 47 const url::Origin origin(details.entry->GetVirtualURL()); |
48 bool have_already_seen_origin = service->Insert(origin); | 48 bool have_already_seen_origin = service->Insert(origin); |
49 | 49 |
50 navigation_metrics::RecordMainFrameNavigation( | 50 navigation_metrics::RecordMainFrameNavigation( |
51 details.entry->GetVirtualURL(), details.is_in_page, | 51 details.entry->GetVirtualURL(), details.is_in_page, |
52 context->IsOffTheRecord(), have_already_seen_origin); | 52 context->IsOffTheRecord(), have_already_seen_origin); |
53 | 53 |
54 // Record the domain and registry of the URL that resulted in a navigation to | 54 // Record the domain and registry of the URL that resulted in a navigation to |
55 // a |data:| URL, either by redirects or user clicking a link. | 55 // a |data:| URL, either by redirects or user clicking a link. |
56 if (details.entry->GetVirtualURL().SchemeIs(url::kDataScheme) && | 56 if (details.entry->GetVirtualURL().SchemeIs(url::kDataScheme) && |
57 params.transition != ui::PAGE_TRANSITION_TYPED && | 57 !ui::PageTransitionCoreTypeIs(params.transition, |
| 58 ui::PAGE_TRANSITION_TYPED) && |
58 !details.previous_url.is_empty()) { | 59 !details.previous_url.is_empty()) { |
59 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 60 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
60 "Navigation.Scheme.Data", | 61 "Navigation.Scheme.Data", |
61 details.previous_url); | 62 details.previous_url); |
62 } | 63 } |
63 } | 64 } |
OLD | NEW |