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

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

Issue 1920563002: Only trigger navigation in distiller if in print preview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 8 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_distiller.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc b/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc
index 6dc6db85ded55449c6c8878d80e4c6678a2554e5..8622262adc9660bb34828add5a1ff93e3ad2fa3b 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc
@@ -136,6 +136,13 @@ class PrintPreviewDistiller::WebContentsDelegateImpl
render_frame_host->GetRoutingID(), true));
}
+ void DidFinishLoad(content::RenderFrameHost* render_frame_host,
+ const GURL& validated_url) override {
+ // Notify distiller that print preview is using it.
+ dom_distiller::RunIsolatedJavaScript(web_contents()->GetMainFrame(),
+ "var is_print_preview_distiller = true;");
Bernhard Bauer 2016/04/25 15:36:38 Nit: Arguments should be aligned if they're broken
mdjones 2016/04/25 16:33:13 Done.
Bernhard Bauer 2016/04/25 17:30:31 Sorry, too many nested languages ;-) What I meant
mdjones 2016/04/25 18:24:07 Reverted to just fix indent. The problem is that t
+ }
+
void DoPrintPreview() {
RenderViewHost* rvh = web_contents()->GetRenderViewHost();
rvh->Send(new PrintMsg_InitiatePrintPreview(rvh->GetRoutingID(), false));

Powered by Google App Engine
This is Rietveld 408576698