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

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

Issue 96233002: Add a PDF component extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/resources/pdf/background.js
diff --git a/chrome/browser/resources/pdf/background.js b/chrome/browser/resources/pdf/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..fa0e36879d7bb88fa8626645fa7f42a6b112ec62
--- /dev/null
+++ b/chrome/browser/resources/pdf/background.js
@@ -0,0 +1,8 @@
+chrome.streamsPrivate.onExecuteMimeTypeHandler.addListener(
+ function(mime_type, original_url, content_url, tab_id) {
+ // TODO(raymes): Currently this doesn't work with embedded PDFs (it
+ // causes the entire frame to navigate). Also work out how we can
+ // mask the URL with the URL of the PDF.
+ chrome.tabs.update(tab_id, { url: 'pdf.html?' + original_url });
+ }
+);

Powered by Google App Engine
This is Rietveld 408576698