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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 #include "components/content_settings/core/browser/host_content_settings_map.h" | 119 #include "components/content_settings/core/browser/host_content_settings_map.h" |
120 #include "components/content_settings/core/common/content_settings.h" | 120 #include "components/content_settings/core/common/content_settings.h" |
121 #include "components/content_settings/core/common/content_settings_types.h" | 121 #include "components/content_settings/core/common/content_settings_types.h" |
122 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m
essage_filter.h" | 122 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m
essage_filter.h" |
123 #include "components/dom_distiller/core/dom_distiller_switches.h" | 123 #include "components/dom_distiller/core/dom_distiller_switches.h" |
124 #include "components/dom_distiller/core/url_constants.h" | 124 #include "components/dom_distiller/core/url_constants.h" |
125 #include "components/error_page/common/error_page_switches.h" | 125 #include "components/error_page/common/error_page_switches.h" |
126 #include "components/google/core/browser/google_util.h" | 126 #include "components/google/core/browser/google_util.h" |
127 #include "components/metrics/client_info.h" | 127 #include "components/metrics/client_info.h" |
128 #include "components/net_log/chrome_net_log.h" | 128 #include "components/net_log/chrome_net_log.h" |
| 129 #include "components/page_load_metrics/browser/metrics_navigation_throttle.h" |
129 #include "components/pref_registry/pref_registry_syncable.h" | 130 #include "components/pref_registry/pref_registry_syncable.h" |
130 #include "components/prefs/pref_service.h" | 131 #include "components/prefs/pref_service.h" |
131 #include "components/prefs/scoped_user_pref_update.h" | 132 #include "components/prefs/scoped_user_pref_update.h" |
132 #include "components/rappor/rappor_utils.h" | 133 #include "components/rappor/rappor_utils.h" |
133 #include "components/security_interstitials/core/ssl_error_ui.h" | 134 #include "components/security_interstitials/core/ssl_error_ui.h" |
134 #include "components/signin/core/common/profile_management_switches.h" | 135 #include "components/signin/core/common/profile_management_switches.h" |
135 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" | 136 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" |
136 #include "components/subresource_filter/content/browser/subresource_filter_navig
ation_throttle.h" | 137 #include "components/subresource_filter/content/browser/subresource_filter_navig
ation_throttle.h" |
137 #include "components/translate/core/common/translate_switches.h" | 138 #include "components/translate/core/common/translate_switches.h" |
138 #include "components/url_formatter/url_fixer.h" | 139 #include "components/url_formatter/url_fixer.h" |
(...skipping 2774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2913 if (url.is_valid()) { | 2914 if (url.is_valid()) { |
2914 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 2915 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
2915 metric, url); | 2916 metric, url); |
2916 } | 2917 } |
2917 } | 2918 } |
2918 | 2919 |
2919 ScopedVector<content::NavigationThrottle> | 2920 ScopedVector<content::NavigationThrottle> |
2920 ChromeContentBrowserClient::CreateThrottlesForNavigation( | 2921 ChromeContentBrowserClient::CreateThrottlesForNavigation( |
2921 content::NavigationHandle* handle) { | 2922 content::NavigationHandle* handle) { |
2922 ScopedVector<content::NavigationThrottle> throttles; | 2923 ScopedVector<content::NavigationThrottle> throttles; |
| 2924 if (handle->IsInMainFrame()) { |
| 2925 throttles.push_back( |
| 2926 page_load_metrics::MetricsNavigationThrottle::Create(handle)); |
| 2927 } |
| 2928 |
2923 #if defined(OS_ANDROID) | 2929 #if defined(OS_ANDROID) |
2924 // TODO(davidben): This is insufficient to integrate with prerender properly. | 2930 // TODO(davidben): This is insufficient to integrate with prerender properly. |
2925 // https://crbug.com/370595 | 2931 // https://crbug.com/370595 |
2926 prerender::PrerenderContents* prerender_contents = | 2932 prerender::PrerenderContents* prerender_contents = |
2927 prerender::PrerenderContents::FromWebContents(handle->GetWebContents()); | 2933 prerender::PrerenderContents::FromWebContents(handle->GetWebContents()); |
2928 if (!prerender_contents && handle->IsInMainFrame()) { | 2934 if (!prerender_contents && handle->IsInMainFrame()) { |
2929 throttles.push_back( | 2935 throttles.push_back( |
2930 navigation_interception::InterceptNavigationDelegate::CreateThrottleFor( | 2936 navigation_interception::InterceptNavigationDelegate::CreateThrottleFor( |
2931 handle)); | 2937 handle)); |
2932 } | 2938 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3068 if (channel <= kMaxDisableEncryptionChannel) { | 3074 if (channel <= kMaxDisableEncryptionChannel) { |
3069 static const char* const kWebRtcDevSwitchNames[] = { | 3075 static const char* const kWebRtcDevSwitchNames[] = { |
3070 switches::kDisableWebRtcEncryption, | 3076 switches::kDisableWebRtcEncryption, |
3071 }; | 3077 }; |
3072 to_command_line->CopySwitchesFrom(from_command_line, | 3078 to_command_line->CopySwitchesFrom(from_command_line, |
3073 kWebRtcDevSwitchNames, | 3079 kWebRtcDevSwitchNames, |
3074 arraysize(kWebRtcDevSwitchNames)); | 3080 arraysize(kWebRtcDevSwitchNames)); |
3075 } | 3081 } |
3076 } | 3082 } |
3077 #endif // defined(ENABLE_WEBRTC) | 3083 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |