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); }); |