| 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 "base/command_line.h" | 7 #include "base/command_line.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/content_settings/chrome_content_settings_client.h" | 10 #include "chrome/browser/content_settings/chrome_content_settings_client.h" |
| 11 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 11 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 12 #include "chrome/browser/engagement/site_engagement_helper.h" | 12 #include "chrome/browser/engagement/site_engagement_helper.h" |
| 13 #include "chrome/browser/engagement/site_engagement_service.h" | 13 #include "chrome/browser/engagement/site_engagement_service.h" |
| 14 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 14 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
| 15 #include "chrome/browser/favicon/favicon_utils.h" | 15 #include "chrome/browser/favicon/favicon_utils.h" |
| 16 #include "chrome/browser/history/history_tab_helper.h" | 16 #include "chrome/browser/history/history_tab_helper.h" |
| 17 #include "chrome/browser/history/top_sites_factory.h" | 17 #include "chrome/browser/history/top_sites_factory.h" |
| 18 #include "chrome/browser/infobars/infobar_service.h" | 18 #include "chrome/browser/infobars/infobar_service.h" |
| 19 #include "chrome/browser/metrics/desktop_engagement/desktop_engagement_observer.
h" |
| 19 #include "chrome/browser/net/net_error_tab_helper.h" | 20 #include "chrome/browser/net/net_error_tab_helper.h" |
| 20 #include "chrome/browser/net/predictor_tab_helper.h" | 21 #include "chrome/browser/net/predictor_tab_helper.h" |
| 21 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" | 22 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" |
| 22 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 23 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 23 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 24 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 24 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" | 25 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" |
| 25 #include "chrome/browser/prerender/prerender_tab_helper.h" | 26 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/sessions/session_tab_helper.h" | 28 #include "chrome/browser/sessions/session_tab_helper.h" |
| 28 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 29 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 SearchEngineTabHelper::CreateForWebContents(web_contents); | 212 SearchEngineTabHelper::CreateForWebContents(web_contents); |
| 212 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); | 213 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); |
| 213 TabDialogs::CreateForWebContents(web_contents); | 214 TabDialogs::CreateForWebContents(web_contents); |
| 214 ThumbnailTabHelper::CreateForWebContents(web_contents); | 215 ThumbnailTabHelper::CreateForWebContents(web_contents); |
| 215 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); | 216 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); |
| 216 | 217 |
| 217 if (banners::AppBannerManagerDesktop::IsEnabled()) | 218 if (banners::AppBannerManagerDesktop::IsEnabled()) |
| 218 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); | 219 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); |
| 219 #endif | 220 #endif |
| 220 | 221 |
| 221 // --- Feature tab helpers behind flags --- | 222 #if defined(OS_WIN) || defined(OS_MACOSX) || \ |
| 223 (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 224 metrics::DesktopEngagementObserver::CreateForWebContents(web_contents); |
| 225 #endif |
| 226 // --- Feature tab helpers behind flags --- |
| 222 | 227 |
| 223 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 228 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 224 CaptivePortalTabHelper::CreateForWebContents(web_contents); | 229 CaptivePortalTabHelper::CreateForWebContents(web_contents); |
| 225 #endif | 230 #endif |
| 226 | 231 |
| 227 #if defined(ENABLE_EXTENSIONS) | 232 #if defined(ENABLE_EXTENSIONS) |
| 228 extensions::TabHelper::CreateForWebContents(web_contents); | 233 extensions::TabHelper::CreateForWebContents(web_contents); |
| 229 #endif | 234 #endif |
| 230 | 235 |
| 231 #if defined(ENABLE_SUPERVISED_USERS) | 236 #if defined(ENABLE_SUPERVISED_USERS) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 250 | 255 |
| 251 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 256 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 252 web_contents->GetBrowserContext())) { | 257 web_contents->GetBrowserContext())) { |
| 253 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 258 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
| 254 web_contents); | 259 web_contents); |
| 255 } | 260 } |
| 256 | 261 |
| 257 if (tracing::NavigationTracingObserver::IsEnabled()) | 262 if (tracing::NavigationTracingObserver::IsEnabled()) |
| 258 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 263 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 259 } | 264 } |
| OLD | NEW |