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

Side by Side Diff: chrome/browser/resources/pdf/main.js

Issue 726343002: OOP PDF: Add whether a resource is embedded to StreamInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@embedded-pdfs
Patch Set: address comment Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 <include src="../../../../ui/webui/resources/js/util.js"> 7 <include src="../../../../ui/webui/resources/js/util.js">
8 <include src="open_pdf_params_parser.js"> 8 <include src="open_pdf_params_parser.js">
9 <include src="pdf.js"> 9 <include src="pdf.js">
10 <include src="pdf_scripting_api.js"> 10 <include src="pdf_scripting_api.js">
(...skipping 28 matching lines...) Expand all
39 39
40 // The viewer may be started directly by passing in the URL of the PDF to load 40 // The viewer may be started directly by passing in the URL of the PDF to load
41 // as the query string. This is used for print preview in particular. The URL 41 // as the query string. This is used for print preview in particular. The URL
42 // of this page will be of the form 42 // of this page will be of the form
43 // 'chrome-extension://<extension id>?<pdf url>'. We pull out the <pdf url> 43 // 'chrome-extension://<extension id>?<pdf url>'. We pull out the <pdf url>
44 // part here. 44 // part here.
45 var url = window.location.search.substring(1); 45 var url = window.location.search.substring(1);
46 var streamDetails = { 46 var streamDetails = {
47 streamUrl: url, 47 streamUrl: url,
48 originalUrl: url, 48 originalUrl: url,
49 responseHeaders: '' 49 responseHeaders: '',
50 embedded: window.parent != window,
51 tabId: -1
50 }; 52 };
51 viewer = new PDFViewer(streamDetails); 53 if (!chrome.tabs) {
54 viewer = new PDFViewer(streamDetails);
55 return;
56 }
57 chrome.tabs.getCurrent(function(tab) {
58 if (tab && tab.id != undefined)
59 streamDetails.tabId = tab.id;
60 viewer = new PDFViewer(streamDetails);
61 });
52 })(); 62 })();
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc ('k') | chrome/browser/resources/pdf/pdf.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698