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

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

Issue 2299943002: Record the PDF and top level URL when the PDF plugin crashes. (Closed)
Patch Set: Created 4 years, 4 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/resources/pdf/browser_api.js
diff --git a/chrome/browser/resources/pdf/browser_api.js b/chrome/browser/resources/pdf/browser_api.js
index 53f14b5460e770d538a8ff1eacd57811510b8bcd..dacbac3b984f72cc141e8fe34c07724c923535a3 100644
--- a/chrome/browser/resources/pdf/browser_api.js
+++ b/chrome/browser/resources/pdf/browser_api.js
@@ -154,6 +154,12 @@ function createBrowserApiForMimeHandlerView() {
}).then(function(streamInfo) {
let manageZoom = !streamInfo.embedded && streamInfo.tabId != -1;
raymes 2016/09/05 04:11:47 It does feel a bit weird that we pass in whether t
return new Promise(function(resolve, reject) {
+ if (streamInfo.tabId != -1) {
+ chrome.tabs.get(streamInfo.tabId, function(tab) {
+ streamInfo.tabUrl = tab.url;
+ resolve();
+ });
+ }
raymes 2016/09/05 04:11:47 Hmm this doesn't look quite right to me. resolve()
Lei Zhang 2016/09/07 00:12:38 Uhh, no idea what I'm doing exactly. Let's take an
if (!manageZoom) {
resolve();
return;
@@ -185,6 +191,7 @@ function createBrowserApiForStandaloneExtension() {
}
chrome.tabs.getCurrent(function(tab) {
streamInfo.tabId = tab.id;
+ streamInfo.tabUrl = tab.url;
resolve();
});
}).then(function() { return BrowserApi.create(streamInfo, false); });

Powered by Google App Engine
This is Rietveld 408576698