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

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

Issue 292653004: Handle navigate and email messages from the OOP PDF plugin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | 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 1e6938f374b5699ba2ae158649902e5addbe85db..e8235d36d230ab656af3dc24254629c323e831f8 100644
--- a/chrome/browser/resources/pdf/pdf.js
+++ b/chrome/browser/resources/pdf/pdf.js
@@ -257,6 +257,14 @@ PDFViewer.prototype = {
this.pageIndicator_.initialFadeIn();
this.toolbar_.initialFadeIn();
break;
+ case 'email':
+ var href = 'mailto:' + message.data.to + '?cc=' + message.data.cc +
+ '&bcc=' + message.data.bcc + '&subject=' + message.data.subject +
+ '&body=' + message.data.body;
+ var w = window.open(href, '_blank', 'width=1,height=1');
+ if (w)
+ w.close();
+ break;
case 'getAccessibilityJSONReply':
this.sendScriptingMessage_(message.data);
break;
@@ -274,6 +282,12 @@ PDFViewer.prototype = {
case 'loadProgress':
this.updateProgress_(message.data.progress);
break;
+ case 'navigate':
+ if (message.data.newTab)
+ window.open(message.data.url);
+ else
+ window.location.href = message.data.url;
+ break;
case 'setScrollPosition':
var position = this.viewport_.position;
if (message.data.x != undefined)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698