Chromium Code Reviews| 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" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 #include "components/tracing/common/tracing_switches.h" | 52 #include "components/tracing/common/tracing_switches.h" |
| 53 #include "content/public/browser/web_contents.h" | 53 #include "content/public/browser/web_contents.h" |
| 54 | 54 |
| 55 #if BUILDFLAG(ANDROID_JAVA_UI) | 55 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 56 #include "chrome/browser/android/banners/app_banner_manager_android.h" | 56 #include "chrome/browser/android/banners/app_banner_manager_android.h" |
| 57 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" | 57 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" |
| 58 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" | 58 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" |
| 59 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" | 59 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" |
| 60 #include "chrome/browser/android/voice_search_tab_helper.h" | 60 #include "chrome/browser/android/voice_search_tab_helper.h" |
| 61 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 61 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 62 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | |
| 63 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" | |
| 62 #include "chrome/browser/ui/android/context_menu_helper.h" | 64 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 63 #include "chrome/browser/ui/android/view_android_helper.h" | 65 #include "chrome/browser/ui/android/view_android_helper.h" |
| 64 #include "components/offline_pages/offline_page_feature.h" | 66 #include "components/offline_pages/offline_page_feature.h" |
| 65 #else | 67 #else |
| 66 #include "chrome/browser/banners/app_banner_manager_desktop.h" | 68 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
| 67 #include "chrome/browser/permissions/permission_request_manager.h" | 69 #include "chrome/browser/permissions/permission_request_manager.h" |
| 68 #include "chrome/browser/plugins/plugin_observer.h" | 70 #include "chrome/browser/plugins/plugin_observer.h" |
| 69 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 71 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 70 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 72 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 71 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 73 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 ContextMenuHelper::CreateForWebContents(web_contents); | 189 ContextMenuHelper::CreateForWebContents(web_contents); |
| 188 DataUseTabHelper::CreateForWebContents(web_contents); | 190 DataUseTabHelper::CreateForWebContents(web_contents); |
| 189 | 191 |
| 190 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); | 192 offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents); |
| 191 if (offline_pages::IsOffliningRecentPagesEnabled()) | 193 if (offline_pages::IsOffliningRecentPagesEnabled()) |
| 192 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); | 194 offline_pages::RecentTabHelper::CreateForWebContents(web_contents); |
| 193 | 195 |
| 194 SingleTabModeTabHelper::CreateForWebContents(web_contents); | 196 SingleTabModeTabHelper::CreateForWebContents(web_contents); |
| 195 ViewAndroidHelper::CreateForWebContents(web_contents); | 197 ViewAndroidHelper::CreateForWebContents(web_contents); |
| 196 VoiceSearchTabHelper::CreateForWebContents(web_contents); | 198 VoiceSearchTabHelper::CreateForWebContents(web_contents); |
| 199 | |
| 200 BookmarkLastVisitUpdater::CreateForWebContentsWithBookmarkModel( | |
| 201 web_contents, | |
| 202 BookmarkModelFactory::GetForProfile( | |
| 203 Profile::FromBrowserContext(web_contents->GetBrowserContext()))); | |
|
Avi (use Gerrit)
2016/08/03 14:47:40
Alphabetical order, please.
Philipp Keck
2016/08/03 15:37:34
Done.
| |
| 197 #else | 204 #else |
| 198 BookmarkTabHelper::CreateForWebContents(web_contents); | 205 BookmarkTabHelper::CreateForWebContents(web_contents); |
| 199 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 206 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 200 web_contents); | 207 web_contents); |
| 201 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); | 208 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); |
| 202 HungPluginTabHelper::CreateForWebContents(web_contents); | 209 HungPluginTabHelper::CreateForWebContents(web_contents); |
| 203 ManagePasswordsUIController::CreateForWebContents(web_contents); | 210 ManagePasswordsUIController::CreateForWebContents(web_contents); |
| 204 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( | 211 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( |
| 205 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( | 212 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( |
| 206 new ChromePDFWebContentsHelperClient())); | 213 new ChromePDFWebContentsHelperClient())); |
| 207 PermissionRequestManager::CreateForWebContents(web_contents); | 214 PermissionRequestManager::CreateForWebContents(web_contents); |
| 208 PluginObserver::CreateForWebContents(web_contents); | 215 PluginObserver::CreateForWebContents(web_contents); |
| 209 SadTabHelper::CreateForWebContents(web_contents); | 216 SadTabHelper::CreateForWebContents(web_contents); |
| 210 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); | 217 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); |
| 211 SearchEngineTabHelper::CreateForWebContents(web_contents); | 218 SearchEngineTabHelper::CreateForWebContents(web_contents); |
| 212 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); | 219 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); |
| 213 TabDialogs::CreateForWebContents(web_contents); | 220 TabDialogs::CreateForWebContents(web_contents); |
| 214 ThumbnailTabHelper::CreateForWebContents(web_contents); | 221 ThumbnailTabHelper::CreateForWebContents(web_contents); |
| 215 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); | 222 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); |
| 216 | 223 |
| 217 if (banners::AppBannerManagerDesktop::IsEnabled()) | 224 if (banners::AppBannerManagerDesktop::IsEnabled()) |
| 218 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); | 225 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); |
| 219 #endif | 226 #endif |
| 220 | 227 |
| 221 // --- Feature tab helpers behind flags --- | 228 // --- Feature tab helpers behind flags --- |
| 222 | 229 |
| 223 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 230 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 224 CaptivePortalTabHelper::CreateForWebContents(web_contents); | 231 CaptivePortalTabHelper::CreateForWebContents(web_contents); |
| 225 #endif | 232 #endif |
| 226 | 233 |
| 227 #if defined(ENABLE_EXTENSIONS) | 234 #if defined(ENABLE_EXTENSIONS) |
| 228 extensions::TabHelper::CreateForWebContents(web_contents); | 235 extensions::TabHelper::CreateForWebContents(web_contents); |
| 229 #endif | 236 #endif |
| 230 | 237 |
| 231 #if defined(ENABLE_SUPERVISED_USERS) | 238 #if defined(ENABLE_SUPERVISED_USERS) |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 250 | 257 |
| 251 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 258 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 252 web_contents->GetBrowserContext())) { | 259 web_contents->GetBrowserContext())) { |
| 253 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 260 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
| 254 web_contents); | 261 web_contents); |
| 255 } | 262 } |
| 256 | 263 |
| 257 if (tracing::NavigationTracingObserver::IsEnabled()) | 264 if (tracing::NavigationTracingObserver::IsEnabled()) |
| 258 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 265 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 259 } | 266 } |
| OLD | NEW |