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" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 52 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
53 #include "components/autofill/core/browser/autofill_manager.h" | 53 #include "components/autofill/core/browser/autofill_manager.h" |
54 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" | 54 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" |
55 #include "components/dom_distiller/core/dom_distiller_switches.h" | 55 #include "components/dom_distiller/core/dom_distiller_switches.h" |
56 #include "components/history/content/browser/web_contents_top_sites_observer.h" | 56 #include "components/history/content/browser/web_contents_top_sites_observer.h" |
57 #include "components/history/core/browser/top_sites.h" | 57 #include "components/history/core/browser/top_sites.h" |
58 #include "components/password_manager/core/browser/password_manager.h" | 58 #include "components/password_manager/core/browser/password_manager.h" |
59 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 59 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
60 #include "components/tracing/common/tracing_switches.h" | 60 #include "components/tracing/common/tracing_switches.h" |
61 #include "content/public/browser/web_contents.h" | 61 #include "content/public/browser/web_contents.h" |
| 62 #include "printing/features/features.h" |
62 | 63 |
63 #if BUILDFLAG(ANDROID_JAVA_UI) | 64 #if BUILDFLAG(ANDROID_JAVA_UI) |
64 #include "chrome/browser/android/banners/app_banner_manager_android.h" | 65 #include "chrome/browser/android/banners/app_banner_manager_android.h" |
65 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" | 66 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" |
66 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" | 67 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" |
67 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" | 68 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" |
68 #include "chrome/browser/android/voice_search_tab_helper.h" | 69 #include "chrome/browser/android/voice_search_tab_helper.h" |
69 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 70 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
70 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 71 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
71 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" | 72 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" |
(...skipping 22 matching lines...) Expand all Loading... |
94 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 95 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
95 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 96 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
96 #include "chrome/browser/extensions/tab_helper.h" | 97 #include "chrome/browser/extensions/tab_helper.h" |
97 #include "extensions/browser/view_type_utils.h" | 98 #include "extensions/browser/view_type_utils.h" |
98 #endif | 99 #endif |
99 | 100 |
100 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 101 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
101 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" | 102 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" |
102 #endif | 103 #endif |
103 | 104 |
104 #if defined(ENABLE_PRINTING) | 105 #if BUILDFLAG(ENABLE_PRINTING) |
105 #if defined(ENABLE_PRINT_PREVIEW) | 106 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
106 #include "chrome/browser/printing/print_preview_message_handler.h" | 107 #include "chrome/browser/printing/print_preview_message_handler.h" |
107 #include "chrome/browser/printing/print_view_manager.h" | 108 #include "chrome/browser/printing/print_view_manager.h" |
108 #else | 109 #else |
109 #include "chrome/browser/printing/print_view_manager_basic.h" | 110 #include "chrome/browser/printing/print_view_manager_basic.h" |
110 #endif // defined(ENABLE_PRINT_PREVIEW) | 111 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
111 #endif // defined(ENABLE_PRINTING) | 112 #endif // BUILDFLAG(ENABLE_PRINTING) |
112 | 113 |
113 using content::WebContents; | 114 using content::WebContents; |
114 | 115 |
115 namespace { | 116 namespace { |
116 | 117 |
117 const char kTabContentsAttachedTabHelpersUserDataKey[] = | 118 const char kTabContentsAttachedTabHelpersUserDataKey[] = |
118 "TabContentsAttachedTabHelpers"; | 119 "TabContentsAttachedTabHelpers"; |
119 | 120 |
120 } // namespace | 121 } // namespace |
121 | 122 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 #endif | 245 #endif |
245 | 246 |
246 #if defined(ENABLE_EXTENSIONS) | 247 #if defined(ENABLE_EXTENSIONS) |
247 extensions::TabHelper::CreateForWebContents(web_contents); | 248 extensions::TabHelper::CreateForWebContents(web_contents); |
248 #endif | 249 #endif |
249 | 250 |
250 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 251 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
251 SupervisedUserNavigationObserver::CreateForWebContents(web_contents); | 252 SupervisedUserNavigationObserver::CreateForWebContents(web_contents); |
252 #endif | 253 #endif |
253 | 254 |
254 #if defined(ENABLE_PRINTING) && !BUILDFLAG(ANDROID_JAVA_UI) | 255 #if BUILDFLAG(ENABLE_PRINTING) && !BUILDFLAG(ANDROID_JAVA_UI) |
255 #if defined(ENABLE_PRINT_PREVIEW) | 256 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
256 printing::PrintViewManager::CreateForWebContents(web_contents); | 257 printing::PrintViewManager::CreateForWebContents(web_contents); |
257 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 258 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
258 #else | 259 #else |
259 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 260 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
260 #endif // defined(ENABLE_PRINT_PREVIEW) | 261 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
261 #endif // defined(ENABLE_PRINTING) && !BUILDFLAG(ANDROID_JAVA_UI) | 262 #endif // BUILDFLAG(ENABLE_PRINTING) && !BUILDFLAG(ANDROID_JAVA_UI) |
262 | 263 |
263 bool enabled_distiller = base::CommandLine::ForCurrentProcess()->HasSwitch( | 264 bool enabled_distiller = base::CommandLine::ForCurrentProcess()->HasSwitch( |
264 switches::kEnableDomDistiller); | 265 switches::kEnableDomDistiller); |
265 if (enabled_distiller) { | 266 if (enabled_distiller) { |
266 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( | 267 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( |
267 web_contents); | 268 web_contents); |
268 } | 269 } |
269 | 270 |
270 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 271 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
271 web_contents->GetBrowserContext())) { | 272 web_contents->GetBrowserContext())) { |
272 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 273 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
273 web_contents); | 274 web_contents); |
274 } | 275 } |
275 | 276 |
276 if (tracing::NavigationTracingObserver::IsEnabled()) | 277 if (tracing::NavigationTracingObserver::IsEnabled()) |
277 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 278 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
278 } | 279 } |
OLD | NEW |