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

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: Small refactors, formatting, and removing call to distillation heuristics. 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
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | components/dom_distiller/core/dom_distiller_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..52bdfc54c40490e734b67e5a58084d887a5c8554 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -1292,20 +1292,18 @@ void PrintPreviewHandler::SendInitialSettings(
web_ui()->CallJavascriptFunction("setInitialSettings", initial_settings);
WebContents* initiator = GetInitiator();
- if (initiator && cmdline->HasSwitch(switches::kEnableDomDistiller) &&
+ if (initiator &&
+ !(cmdline->HasSwitch(switches::kDisablePrintPreviewSimplify)) &&
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) {
Vitaly Buka (NO REVIEWS) 2015/10/29 18:44:01 Please remove HandleIsPageDistillableResult as unu
mvendramini_hp 2015/10/29 18:52:32 Done.
VLOG(1) << "Distillable page detection finished";
if (distillable)
- web_ui()->CallJavascriptFunction("detectDistillablePage");
+ web_ui()->CallJavascriptFunction("allowDistillPage");
}
void PrintPreviewHandler::ClosePreviewDialog() {
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | components/dom_distiller/core/dom_distiller_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698