| 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/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 14 #include "chrome/browser/data_use_measurement/data_use_web_contents_observer.h" | 14 #include "chrome/browser/data_use_measurement/data_use_web_contents_observer.h" |
| 15 #include "chrome/browser/engagement/site_engagement_helper.h" | 15 #include "chrome/browser/engagement/site_engagement_helper.h" |
| 16 #include "chrome/browser/engagement/site_engagement_service.h" | 16 #include "chrome/browser/engagement/site_engagement_service.h" |
| 17 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 17 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
| 18 #include "chrome/browser/favicon/favicon_utils.h" | 18 #include "chrome/browser/favicon/favicon_utils.h" |
| 19 #include "chrome/browser/history/history_tab_helper.h" | 19 #include "chrome/browser/history/history_tab_helper.h" |
| 20 #include "chrome/browser/history/top_sites_factory.h" | 20 #include "chrome/browser/history/top_sites_factory.h" |
| 21 #include "chrome/browser/infobars/infobar_service.h" | 21 #include "chrome/browser/infobars/infobar_service.h" |
| 22 #include "chrome/browser/metrics/desktop_session_duration/desktop_session_durati
on_observer.h" | 22 #include "chrome/browser/metrics/desktop_session_duration/desktop_session_durati
on_observer.h" |
| 23 #include "chrome/browser/net/net_error_tab_helper.h" | 23 #include "chrome/browser/net/net_error_tab_helper.h" |
| 24 #include "chrome/browser/net/predictor_tab_helper.h" | 24 #include "chrome/browser/net/predictor_tab_helper.h" |
| 25 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" | 25 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" |
| 26 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 26 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 27 #include "chrome/browser/permissions/permission_request_manager.h" |
| 27 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 28 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 28 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" | 29 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" |
| 29 #include "chrome/browser/prerender/prerender_tab_helper.h" | 30 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 30 #include "chrome/browser/previews/previews_infobar_tab_helper.h" | 31 #include "chrome/browser/previews/previews_infobar_tab_helper.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/sessions/session_tab_helper.h" | 33 #include "chrome/browser/sessions/session_tab_helper.h" |
| 33 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 34 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
| 34 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" | 35 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" |
| 35 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 36 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
| 36 #include "chrome/browser/tracing/navigation_tracing.h" | 37 #include "chrome/browser/tracing/navigation_tracing.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 65 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" | 66 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" |
| 66 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" | 67 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" |
| 67 #include "chrome/browser/android/voice_search_tab_helper.h" | 68 #include "chrome/browser/android/voice_search_tab_helper.h" |
| 68 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 69 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 69 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 70 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 70 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" | 71 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" |
| 71 #include "chrome/browser/ui/android/context_menu_helper.h" | 72 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 72 #include "chrome/browser/ui/android/view_android_helper.h" | 73 #include "chrome/browser/ui/android/view_android_helper.h" |
| 73 #else | 74 #else |
| 74 #include "chrome/browser/banners/app_banner_manager_desktop.h" | 75 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
| 75 #include "chrome/browser/permissions/permission_request_manager.h" | |
| 76 #include "chrome/browser/plugins/plugin_observer.h" | 76 #include "chrome/browser/plugins/plugin_observer.h" |
| 77 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 77 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 78 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 78 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 79 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 79 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 80 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 80 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
| 81 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h" | 81 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h" |
| 82 #include "chrome/browser/ui/sad_tab_helper.h" | 82 #include "chrome/browser/ui/sad_tab_helper.h" |
| 83 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 83 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 84 #include "components/pdf/browser/pdf_web_contents_helper.h" | 84 #include "components/pdf/browser/pdf_web_contents_helper.h" |
| 85 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 85 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 banners::AppBannerManagerAndroid::CreateForWebContents(web_contents); | 199 banners::AppBannerManagerAndroid::CreateForWebContents(web_contents); |
| 200 BookmarkLastVisitUpdater::CreateForWebContentsWithBookmarkModel( | 200 BookmarkLastVisitUpdater::CreateForWebContentsWithBookmarkModel( |
| 201 web_contents, BookmarkModelFactory::GetForBrowserContext( | 201 web_contents, BookmarkModelFactory::GetForBrowserContext( |
| 202 web_contents->GetBrowserContext())); | 202 web_contents->GetBrowserContext())); |
| 203 ContextMenuHelper::CreateForWebContents(web_contents); | 203 ContextMenuHelper::CreateForWebContents(web_contents); |
| 204 DataUseTabHelper::CreateForWebContents(web_contents); | 204 DataUseTabHelper::CreateForWebContents(web_contents); |
| 205 | 205 |
| 206 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); | 206 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); |
| 207 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); | 207 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); |
| 208 | 208 |
| 209 PermissionRequestManager::CreateForWebContents(web_contents); |
| 209 SingleTabModeTabHelper::CreateForWebContents(web_contents); | 210 SingleTabModeTabHelper::CreateForWebContents(web_contents); |
| 210 ViewAndroidHelper::CreateForWebContents(web_contents); | 211 ViewAndroidHelper::CreateForWebContents(web_contents); |
| 211 VoiceSearchTabHelper::CreateForWebContents(web_contents); | 212 VoiceSearchTabHelper::CreateForWebContents(web_contents); |
| 212 #else | 213 #else |
| 213 BookmarkTabHelper::CreateForWebContents(web_contents); | 214 BookmarkTabHelper::CreateForWebContents(web_contents); |
| 214 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 215 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 215 web_contents); | 216 web_contents); |
| 216 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); | 217 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); |
| 217 HungPluginTabHelper::CreateForWebContents(web_contents); | 218 HungPluginTabHelper::CreateForWebContents(web_contents); |
| 218 JavaScriptDialogTabHelper::CreateForWebContents(web_contents); | 219 JavaScriptDialogTabHelper::CreateForWebContents(web_contents); |
| 219 ManagePasswordsUIController::CreateForWebContents(web_contents); | 220 ManagePasswordsUIController::CreateForWebContents(web_contents); |
| 220 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( | 221 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( |
| 221 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( | 222 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( |
| 222 new ChromePDFWebContentsHelperClient())); | 223 new ChromePDFWebContentsHelperClient())); |
| 223 PermissionRequestManager::CreateForWebContents(web_contents); | |
| 224 PluginObserver::CreateForWebContents(web_contents); | 224 PluginObserver::CreateForWebContents(web_contents); |
| 225 SadTabHelper::CreateForWebContents(web_contents); | 225 SadTabHelper::CreateForWebContents(web_contents); |
| 226 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); | 226 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); |
| 227 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); | 227 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); |
| 228 TabDialogs::CreateForWebContents(web_contents); | 228 TabDialogs::CreateForWebContents(web_contents); |
| 229 ThumbnailTabHelper::CreateForWebContents(web_contents); | 229 ThumbnailTabHelper::CreateForWebContents(web_contents); |
| 230 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); | 230 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); |
| 231 | 231 |
| 232 if (banners::AppBannerManagerDesktop::IsEnabled()) | 232 if (banners::AppBannerManagerDesktop::IsEnabled()) |
| 233 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); | 233 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 270 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 271 web_contents->GetBrowserContext())) { | 271 web_contents->GetBrowserContext())) { |
| 272 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 272 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
| 273 web_contents); | 273 web_contents); |
| 274 } | 274 } |
| 275 | 275 |
| 276 if (tracing::NavigationTracingObserver::IsEnabled()) | 276 if (tracing::NavigationTracingObserver::IsEnabled()) |
| 277 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 277 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 278 } | 278 } |
| OLD | NEW |