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

Unified Diff: chrome/browser/ui/webui/print_preview_ui_html_source.cc

Issue 6982030: Print Preview: Detecting plugin existence before generating the preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments Created 9 years, 7 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_ui_html_source.cc
diff --git a/chrome/browser/ui/webui/print_preview_ui_html_source.cc b/chrome/browser/ui/webui/print_preview_ui_html_source.cc
index be4b583b5190583bb94e9ab2cc247e53f21d8651..e4ea838a29ca9979dae87eec84430d3cb188d879 100644
--- a/chrome/browser/ui/webui/print_preview_ui_html_source.cc
+++ b/chrome/browser/ui/webui/print_preview_ui_html_source.cc
@@ -160,6 +160,18 @@ void PrintPreviewUIHTMLSource::StartDataRequest(const std::string& path,
*it = *(preview_data + i);
SendResponse(request_id, html_bytes);
return;
+ } else if (path == "blank.pdf") {
+ const unsigned char blank_pdf[] = "%PDF-1.4\n3 0 obj<</Type/Catalog/Pages"
vandebo (ex-Chrome) 2011/05/11 22:13:54 kBlankPDF All the start quotes should line up.
dpapad 2011/05/11 23:31:03 It seems like there is no need to pass actual pdf
+ " 1 0 R>>endobj 2 0 obj<</Type/Page/Parent 1 0 R/Resources"
+ "<<>>/MediaBox[0 0 612 792]>>endobj 1 0 obj<</Type"
+ "/Pages/Kids[2 0 R]/Count 1>>endobj\nxref\n0 4\n"
+ "0000000000 65535 f \n0000000129 00000 n \n"
+ "0000000052 00000 n \n0000000009 00000 n \ntrailer<<"
+ "/Size 4/Root 3 0 R>>startxref\n178\n%%EOF\n";
+ scoped_refptr<RefCountedStaticMemory> dummy_bytes(
vandebo (ex-Chrome) 2011/05/11 22:13:54 dummy_bytes -> blank_bytes.
dpapad 2011/05/11 23:31:03 Done.
+ new RefCountedStaticMemory(blank_pdf, sizeof(blank_pdf)));
+ SendResponse(request_id, dummy_bytes);
+ return;
} else {
// Invalid request.
scoped_refptr<RefCountedBytes> empty_bytes(new RefCountedBytes);
« chrome/browser/resources/print_preview.js ('K') | « chrome/browser/resources/print_preview.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698