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

Unified Diff: chrome/browser/resources/pdf/pdf.js

Issue 819983002: OOP PDF: Fix access to chrome://resources in print preview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 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/resources/pdf/manifest-common.json.unflattened ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/pdf.js
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js
index 88e3d26bc5ee57ec2f9146b5605513fb2deda1ae..198078b621d3f67abff047182f5dbc3aff39a840 100644
--- a/chrome/browser/resources/pdf/pdf.js
+++ b/chrome/browser/resources/pdf/pdf.js
@@ -65,18 +65,11 @@ function PDFViewer(streamDetails) {
this.beforeZoom_.bind(this),
this.afterZoom_.bind(this),
getScrollbarWidth());
- var isPrintPreview =
- this.streamDetails.originalUrl.indexOf('chrome://print') == 0;
// Create the plugin object dynamically so we can set its src. The plugin
// element is sized to fill the entire window and is set to be fixed
// positioning, acting as a viewport. The plugin renders into this viewport
// according to the scroll position of the window.
- //
- // TODO(sammc): Remove special casing for print preview. This is currently
- // necessary because setting the src for an embed element triggers origin
- // checking and the PDF extension is not allowed to embed URLs with a scheme
- // of "chrome", which is used by print preview.
- this.plugin_ = document.createElement(isPrintPreview ? 'object' : 'embed');
+ this.plugin_ = document.createElement('embed');
// NOTE: The plugin's 'id' field must be set to 'plugin' since
// chrome/renderer/printing/print_web_view_helper.cc actually references it.
this.plugin_.id = 'plugin';
« no previous file with comments | « chrome/browser/resources/pdf/manifest-common.json.unflattened ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698