OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/tab_helpers.h" | 5 #include "chrome/browser/ui/tab_helpers.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/content_settings/mixed_content_settings.h" |
14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 15 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
15 #include "chrome/browser/data_use_measurement/data_use_web_contents_observer.h" | 16 #include "chrome/browser/data_use_measurement/data_use_web_contents_observer.h" |
16 #include "chrome/browser/engagement/site_engagement_helper.h" | 17 #include "chrome/browser/engagement/site_engagement_helper.h" |
17 #include "chrome/browser/engagement/site_engagement_service.h" | 18 #include "chrome/browser/engagement/site_engagement_service.h" |
18 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 19 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
19 #include "chrome/browser/favicon/favicon_utils.h" | 20 #include "chrome/browser/favicon/favicon_utils.h" |
20 #include "chrome/browser/history/history_tab_helper.h" | 21 #include "chrome/browser/history/history_tab_helper.h" |
21 #include "chrome/browser/history/top_sites_factory.h" | 22 #include "chrome/browser/history/top_sites_factory.h" |
22 #include "chrome/browser/infobars/infobar_service.h" | 23 #include "chrome/browser/infobars/infobar_service.h" |
23 #include "chrome/browser/metrics/desktop_session_duration/desktop_session_durati
on_observer.h" | 24 #include "chrome/browser/metrics/desktop_session_duration/desktop_session_durati
on_observer.h" |
(...skipping 30 matching lines...) Expand all Loading... |
54 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 55 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
55 #include "components/autofill/core/browser/autofill_manager.h" | 56 #include "components/autofill/core/browser/autofill_manager.h" |
56 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" | 57 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" |
57 #include "components/dom_distiller/core/dom_distiller_switches.h" | 58 #include "components/dom_distiller/core/dom_distiller_switches.h" |
58 #include "components/history/content/browser/web_contents_top_sites_observer.h" | 59 #include "components/history/content/browser/web_contents_top_sites_observer.h" |
59 #include "components/history/core/browser/top_sites.h" | 60 #include "components/history/core/browser/top_sites.h" |
60 #include "components/password_manager/core/browser/password_manager.h" | 61 #include "components/password_manager/core/browser/password_manager.h" |
61 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 62 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
62 #include "components/tracing/common/tracing_switches.h" | 63 #include "components/tracing/common/tracing_switches.h" |
63 #include "content/public/browser/web_contents.h" | 64 #include "content/public/browser/web_contents.h" |
| 65 #include "content/public/common/browser_side_navigation_policy.h" |
64 #include "extensions/features/features.h" | 66 #include "extensions/features/features.h" |
65 #include "printing/features/features.h" | 67 #include "printing/features/features.h" |
66 | 68 |
67 #if BUILDFLAG(ANDROID_JAVA_UI) | 69 #if BUILDFLAG(ANDROID_JAVA_UI) |
68 #include "chrome/browser/android/banners/app_banner_manager_android.h" | 70 #include "chrome/browser/android/banners/app_banner_manager_android.h" |
69 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" | 71 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" |
70 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" | 72 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" |
71 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" | 73 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" |
72 #include "chrome/browser/android/search_geolocation/search_geolocation_disclosur
e_tab_helper.h" | 74 #include "chrome/browser/android/search_geolocation/search_geolocation_disclosur
e_tab_helper.h" |
73 #include "chrome/browser/android/voice_search_tab_helper.h" | 75 #include "chrome/browser/android/voice_search_tab_helper.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 SecurityStateTabHelper::CreateForWebContents(web_contents); | 195 SecurityStateTabHelper::CreateForWebContents(web_contents); |
194 if (SiteEngagementService::IsEnabled()) | 196 if (SiteEngagementService::IsEnabled()) |
195 SiteEngagementService::Helper::CreateForWebContents(web_contents); | 197 SiteEngagementService::Helper::CreateForWebContents(web_contents); |
196 std::unique_ptr<ChromeSubresourceFilterClient> subresource_filter_client( | 198 std::unique_ptr<ChromeSubresourceFilterClient> subresource_filter_client( |
197 new ChromeSubresourceFilterClient(web_contents)); | 199 new ChromeSubresourceFilterClient(web_contents)); |
198 subresource_filter::ContentSubresourceFilterDriverFactory:: | 200 subresource_filter::ContentSubresourceFilterDriverFactory:: |
199 CreateForWebContents(web_contents, std::move(subresource_filter_client)); | 201 CreateForWebContents(web_contents, std::move(subresource_filter_client)); |
200 // TODO(vabr): Remove TabSpecificContentSettings from here once their function | 202 // TODO(vabr): Remove TabSpecificContentSettings from here once their function |
201 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 | 203 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 |
202 TabSpecificContentSettings::CreateForWebContents(web_contents); | 204 TabSpecificContentSettings::CreateForWebContents(web_contents); |
| 205 if (content::IsBrowserSideNavigationEnabled()) |
| 206 MixedContentSettings::CreateForWebContents(web_contents); |
203 | 207 |
204 // --- Platform-specific tab helpers --- | 208 // --- Platform-specific tab helpers --- |
205 | 209 |
206 #if BUILDFLAG(ANDROID_JAVA_UI) | 210 #if BUILDFLAG(ANDROID_JAVA_UI) |
207 banners::AppBannerManagerAndroid::CreateForWebContents(web_contents); | 211 banners::AppBannerManagerAndroid::CreateForWebContents(web_contents); |
208 ContextMenuHelper::CreateForWebContents(web_contents); | 212 ContextMenuHelper::CreateForWebContents(web_contents); |
209 DataUseTabHelper::CreateForWebContents(web_contents); | 213 DataUseTabHelper::CreateForWebContents(web_contents); |
210 | 214 |
211 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); | 215 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); |
212 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); | 216 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 280 |
277 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 281 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
278 web_contents->GetBrowserContext())) { | 282 web_contents->GetBrowserContext())) { |
279 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 283 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
280 web_contents); | 284 web_contents); |
281 } | 285 } |
282 | 286 |
283 if (tracing::NavigationTracingObserver::IsEnabled()) | 287 if (tracing::NavigationTracingObserver::IsEnabled()) |
284 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 288 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
285 } | 289 } |
OLD | NEW |