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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 117 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
118 #include "chrome/browser/extensions/tab_helper.h" | 118 #include "chrome/browser/extensions/tab_helper.h" |
119 #include "extensions/browser/view_type_utils.h" | 119 #include "extensions/browser/view_type_utils.h" |
120 #endif | 120 #endif |
121 | 121 |
122 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 122 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
123 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" | 123 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" |
124 #endif | 124 #endif |
125 | 125 |
126 #if BUILDFLAG(ENABLE_PRINTING) | 126 #if BUILDFLAG(ENABLE_PRINTING) |
127 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 127 #include "chrome/browser/printing/printing_init.h" |
128 #include "chrome/browser/printing/print_preview_message_handler.h" | 128 #endif |
129 #include "chrome/browser/printing/print_view_manager.h" | |
130 #else | |
131 #include "chrome/browser/printing/print_view_manager_basic.h" | |
132 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | |
133 #endif // BUILDFLAG(ENABLE_PRINTING) | |
134 | 129 |
135 using content::WebContents; | 130 using content::WebContents; |
136 | 131 |
137 namespace { | 132 namespace { |
138 | 133 |
139 const char kTabContentsAttachedTabHelpersUserDataKey[] = | 134 const char kTabContentsAttachedTabHelpersUserDataKey[] = |
140 "TabContentsAttachedTabHelpers"; | 135 "TabContentsAttachedTabHelpers"; |
141 | 136 |
142 } // namespace | 137 } // namespace |
143 | 138 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 286 |
292 #if BUILDFLAG(ENABLE_EXTENSIONS) | 287 #if BUILDFLAG(ENABLE_EXTENSIONS) |
293 extensions::TabHelper::CreateForWebContents(web_contents); | 288 extensions::TabHelper::CreateForWebContents(web_contents); |
294 #endif | 289 #endif |
295 | 290 |
296 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 291 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
297 SupervisedUserNavigationObserver::CreateForWebContents(web_contents); | 292 SupervisedUserNavigationObserver::CreateForWebContents(web_contents); |
298 #endif | 293 #endif |
299 | 294 |
300 #if BUILDFLAG(ENABLE_PRINTING) && !defined(OS_ANDROID) | 295 #if BUILDFLAG(ENABLE_PRINTING) && !defined(OS_ANDROID) |
301 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 296 printing::InitializePrinting(web_contents); |
302 printing::PrintViewManager::CreateForWebContents(web_contents); | 297 #endif |
303 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | |
304 #else | |
305 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | |
306 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | |
307 #endif // BUILDFLAG(ENABLE_PRINTING) && !defined(OS_ANDROID) | |
308 | 298 |
309 bool enabled_distiller = base::CommandLine::ForCurrentProcess()->HasSwitch( | 299 bool enabled_distiller = base::CommandLine::ForCurrentProcess()->HasSwitch( |
310 switches::kEnableDomDistiller); | 300 switches::kEnableDomDistiller); |
311 if (enabled_distiller) { | 301 if (enabled_distiller) { |
312 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( | 302 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( |
313 web_contents); | 303 web_contents); |
314 } | 304 } |
315 | 305 |
316 if (predictors::LoadingPredictorFactory::GetForProfile( | 306 if (predictors::LoadingPredictorFactory::GetForProfile( |
317 Profile::FromBrowserContext(web_contents->GetBrowserContext()))) { | 307 Profile::FromBrowserContext(web_contents->GetBrowserContext()))) { |
318 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 308 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
319 web_contents); | 309 web_contents); |
320 } | 310 } |
321 | 311 |
322 if (tracing::NavigationTracingObserver::IsEnabled()) | 312 if (tracing::NavigationTracingObserver::IsEnabled()) |
323 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 313 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
324 | 314 |
325 if (MediaEngagementService::IsEnabled()) | 315 if (MediaEngagementService::IsEnabled()) |
326 MediaEngagementService::CreateWebContentsObserver(web_contents); | 316 MediaEngagementService::CreateWebContentsObserver(web_contents); |
327 | 317 |
328 if (ResourceCoordinatorWebContentsObserver::IsEnabled()) | 318 if (ResourceCoordinatorWebContentsObserver::IsEnabled()) |
329 ResourceCoordinatorWebContentsObserver::CreateForWebContents(web_contents); | 319 ResourceCoordinatorWebContentsObserver::CreateForWebContents(web_contents); |
330 } | 320 } |
OLD | NEW |