| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 #endif | 89 #endif |
| 90 | 90 |
| 91 #if defined(ENABLE_SUPERVISED_USERS) | 91 #if defined(ENABLE_SUPERVISED_USERS) |
| 92 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" | 92 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" |
| 93 #endif | 93 #endif |
| 94 | 94 |
| 95 #if defined(ENABLE_PRINTING) | 95 #if defined(ENABLE_PRINTING) |
| 96 #if defined(ENABLE_PRINT_PREVIEW) | 96 #if defined(ENABLE_PRINT_PREVIEW) |
| 97 #include "chrome/browser/printing/print_preview_message_handler.h" | 97 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 98 #include "chrome/browser/printing/print_view_manager.h" | 98 #include "chrome/browser/printing/print_view_manager.h" |
| 99 #include "chrome/browser/ui/webui/print_preview/print_preview_distiller.h" | |
| 100 #else | 99 #else |
| 101 #include "chrome/browser/printing/print_view_manager_basic.h" | 100 #include "chrome/browser/printing/print_view_manager_basic.h" |
| 102 #endif // defined(ENABLE_PRINT_PREVIEW) | 101 #endif // defined(ENABLE_PRINT_PREVIEW) |
| 103 #endif // defined(ENABLE_PRINTING) | 102 #endif // defined(ENABLE_PRINTING) |
| 104 | 103 |
| 105 using content::WebContents; | 104 using content::WebContents; |
| 106 | 105 |
| 107 namespace { | 106 namespace { |
| 108 | 107 |
| 109 const char kTabContentsAttachedTabHelpersUserDataKey[] = | 108 const char kTabContentsAttachedTabHelpersUserDataKey[] = |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 #if defined(ENABLE_PRINT_PREVIEW) | 235 #if defined(ENABLE_PRINT_PREVIEW) |
| 237 printing::PrintViewManager::CreateForWebContents(web_contents); | 236 printing::PrintViewManager::CreateForWebContents(web_contents); |
| 238 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 237 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
| 239 #else | 238 #else |
| 240 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 239 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
| 241 #endif // defined(ENABLE_PRINT_PREVIEW) | 240 #endif // defined(ENABLE_PRINT_PREVIEW) |
| 242 #endif // defined(ENABLE_PRINTING) && !BUILDFLAG(ANDROID_JAVA_UI) | 241 #endif // defined(ENABLE_PRINTING) && !BUILDFLAG(ANDROID_JAVA_UI) |
| 243 | 242 |
| 244 bool enabled_distiller = base::CommandLine::ForCurrentProcess()->HasSwitch( | 243 bool enabled_distiller = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 245 switches::kEnableDomDistiller); | 244 switches::kEnableDomDistiller); |
| 246 #if defined(ENABLE_PRINT_PREVIEW) | |
| 247 if (PrintPreviewDistiller::IsEnabled()) | |
| 248 enabled_distiller = true; | |
| 249 #endif // defined(ENABLE_PRINT_PREVIEW) | |
| 250 | |
| 251 if (enabled_distiller) { | 245 if (enabled_distiller) { |
| 252 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( | 246 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( |
| 253 web_contents); | 247 web_contents); |
| 254 } | 248 } |
| 255 | 249 |
| 256 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 250 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 257 web_contents->GetBrowserContext())) { | 251 web_contents->GetBrowserContext())) { |
| 258 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 252 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
| 259 web_contents); | 253 web_contents); |
| 260 } | 254 } |
| 261 | 255 |
| 262 if (tracing::NavigationTracingObserver::IsEnabled()) | 256 if (tracing::NavigationTracingObserver::IsEnabled()) |
| 263 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 257 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 264 } | 258 } |
| OLD | NEW |