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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 1419063002: Displaying "simplify page" on print preview by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing stale comments. Created 5 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index cf0ab046dec1e896d7dc2182fc19bcf556781aa2..a60b7ddb778359ec5c3da0558941326cea7a56e2 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -1292,22 +1292,14 @@ void PrintPreviewHandler::SendInitialSettings(
web_ui()->CallJavascriptFunction("setInitialSettings", initial_settings);
WebContents* initiator = GetInitiator();
- if (initiator && cmdline->HasSwitch(switches::kEnableDomDistiller) &&
+ if (initiator &&
+ !(cmdline->HasSwitch(switches::kDisablePrintPreviewSimplify)) &&
Lei Zhang 2015/10/29 19:14:57 nit: Too many parenthesis. Just !cmdline->Foo() &&
mvendramini_hp 2015/10/30 11:05:36 Done.
dom_distiller::url_utils::IsUrlDistillable(
initiator->GetLastCommittedURL())) {
- dom_distiller::IsDistillablePage(
- initiator, false,
- base::Bind(&PrintPreviewHandler::HandleIsPageDistillableResult,
- weak_factory_.GetWeakPtr()));
+ web_ui()->CallJavascriptFunction("allowDistillPage");
}
}
-void PrintPreviewHandler::HandleIsPageDistillableResult(bool distillable) {
- VLOG(1) << "Distillable page detection finished";
- if (distillable)
- web_ui()->CallJavascriptFunction("detectDistillablePage");
-}
-
void PrintPreviewHandler::ClosePreviewDialog() {
print_preview_ui()->OnClosePrintPreviewDialog();
}

Powered by Google App Engine
This is Rietveld 408576698