| 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_tab_helper.h" | 14 #include "chrome/browser/content_settings/mixed_content_settings_tab_helper.h" |
| 15 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 15 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 16 #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" |
| 17 #include "chrome/browser/engagement/site_engagement_helper.h" | 17 #include "chrome/browser/engagement/site_engagement_helper.h" |
| 18 #include "chrome/browser/engagement/site_engagement_service.h" | 18 #include "chrome/browser/engagement/site_engagement_service.h" |
| 19 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 19 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
| 20 #include "chrome/browser/favicon/favicon_utils.h" | 20 #include "chrome/browser/favicon/favicon_utils.h" |
| 21 #include "chrome/browser/history/history_tab_helper.h" | 21 #include "chrome/browser/history/history_tab_helper.h" |
| 22 #include "chrome/browser/history/top_sites_factory.h" | 22 #include "chrome/browser/history/top_sites_factory.h" |
| 23 #include "chrome/browser/infobars/infobar_service.h" | 23 #include "chrome/browser/infobars/infobar_service.h" |
| 24 #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" |
| 25 #include "chrome/browser/metrics/renderer_uptime_web_contents_observer.h" |
| 25 #include "chrome/browser/net/net_error_tab_helper.h" | 26 #include "chrome/browser/net/net_error_tab_helper.h" |
| 26 #include "chrome/browser/net/predictor_tab_helper.h" | 27 #include "chrome/browser/net/predictor_tab_helper.h" |
| 27 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" | 28 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" |
| 28 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" | 29 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" |
| 29 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 30 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 30 #include "chrome/browser/permissions/permission_request_manager.h" | 31 #include "chrome/browser/permissions/permission_request_manager.h" |
| 31 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 32 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 32 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" | 33 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" |
| 33 #include "chrome/browser/prerender/prerender_tab_helper.h" | 34 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 34 #include "chrome/browser/previews/previews_infobar_tab_helper.h" | 35 #include "chrome/browser/previews/previews_infobar_tab_helper.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 SiteEngagementService::Helper::CreateForWebContents(web_contents); | 198 SiteEngagementService::Helper::CreateForWebContents(web_contents); |
| 198 std::unique_ptr<ChromeSubresourceFilterClient> subresource_filter_client( | 199 std::unique_ptr<ChromeSubresourceFilterClient> subresource_filter_client( |
| 199 new ChromeSubresourceFilterClient(web_contents)); | 200 new ChromeSubresourceFilterClient(web_contents)); |
| 200 subresource_filter::ContentSubresourceFilterDriverFactory:: | 201 subresource_filter::ContentSubresourceFilterDriverFactory:: |
| 201 CreateForWebContents(web_contents, std::move(subresource_filter_client)); | 202 CreateForWebContents(web_contents, std::move(subresource_filter_client)); |
| 202 // TODO(vabr): Remove TabSpecificContentSettings from here once their function | 203 // TODO(vabr): Remove TabSpecificContentSettings from here once their function |
| 203 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 | 204 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 |
| 204 TabSpecificContentSettings::CreateForWebContents(web_contents); | 205 TabSpecificContentSettings::CreateForWebContents(web_contents); |
| 205 if (content::IsBrowserSideNavigationEnabled()) | 206 if (content::IsBrowserSideNavigationEnabled()) |
| 206 MixedContentSettingsTabHelper::CreateForWebContents(web_contents); | 207 MixedContentSettingsTabHelper::CreateForWebContents(web_contents); |
| 208 metrics::RendererUptimeWebContentsObserver::CreateForWebContents( |
| 209 web_contents); |
| 207 | 210 |
| 208 // --- Platform-specific tab helpers --- | 211 // --- Platform-specific tab helpers --- |
| 209 | 212 |
| 210 #if defined(OS_ANDROID) | 213 #if defined(OS_ANDROID) |
| 211 banners::AppBannerManagerAndroid::CreateForWebContents(web_contents); | 214 banners::AppBannerManagerAndroid::CreateForWebContents(web_contents); |
| 212 ContextMenuHelper::CreateForWebContents(web_contents); | 215 ContextMenuHelper::CreateForWebContents(web_contents); |
| 213 DataUseTabHelper::CreateForWebContents(web_contents); | 216 DataUseTabHelper::CreateForWebContents(web_contents); |
| 214 | 217 |
| 215 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); | 218 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); |
| 216 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); | 219 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 283 |
| 281 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 284 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 282 web_contents->GetBrowserContext())) { | 285 web_contents->GetBrowserContext())) { |
| 283 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 286 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
| 284 web_contents); | 287 web_contents); |
| 285 } | 288 } |
| 286 | 289 |
| 287 if (tracing::NavigationTracingObserver::IsEnabled()) | 290 if (tracing::NavigationTracingObserver::IsEnabled()) |
| 288 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 291 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 289 } | 292 } |
| OLD | NEW |