Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/browser/ui/tab_helpers.cc

Issue 1419063002: Displaying "simplify page" on print preview by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small refactors, formatting, and removing call to distillation heuristics. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/content_settings/chrome_content_settings_client.h" 9 #include "chrome/browser/content_settings/chrome_content_settings_client.h"
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 #if defined(ENABLE_PRINTING) && !defined(OS_ANDROID) 229 #if defined(ENABLE_PRINTING) && !defined(OS_ANDROID)
230 #if defined(ENABLE_PRINT_PREVIEW) 230 #if defined(ENABLE_PRINT_PREVIEW)
231 printing::PrintViewManager::CreateForWebContents(web_contents); 231 printing::PrintViewManager::CreateForWebContents(web_contents);
232 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); 232 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents);
233 #else 233 #else
234 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); 234 printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
235 #endif // defined(ENABLE_PRINT_PREVIEW) 235 #endif // defined(ENABLE_PRINT_PREVIEW)
236 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID) 236 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID)
237 237
238 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 238 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
239 switches::kEnableDomDistiller)) { 239 switches::kEnableDomDistiller) ||
240 !base::CommandLine::ForCurrentProcess()->HasSwitch(
241 switches::kDisablePrintPreviewSimplify)) {
240 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( 242 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents(
241 web_contents); 243 web_contents);
242 } 244 }
243 245
244 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( 246 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile(
245 web_contents->GetBrowserContext())) { 247 web_contents->GetBrowserContext())) {
246 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( 248 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents(
247 web_contents); 249 web_contents);
248 } 250 }
249 251
250 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 252 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
251 switches::kEnableNavigationTracing) && 253 switches::kEnableNavigationTracing) &&
252 base::CommandLine::ForCurrentProcess()->HasSwitch( 254 base::CommandLine::ForCurrentProcess()->HasSwitch(
253 switches::kTraceUploadURL)) { 255 switches::kTraceUploadURL)) {
254 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); 256 tracing::NavigationTracingObserver::CreateForWebContents(web_contents);
255 } 257 }
256 } 258 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698