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

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

Issue 2407713002: Limit PDF helper extension to print preview only (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 7 /**
8 * Returns a promise that will resolve to the default zoom factor. 8 * Returns a promise that will resolve to the default zoom factor.
9 * @param {!Object} streamInfo The stream object pointing to the data contained 9 * @param {!Object} streamInfo The stream object pointing to the data contained
10 * in the PDF. 10 * in the PDF.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 }); 199 });
200 }).then(function() { return BrowserApi.create(streamInfo, false); }); 200 }).then(function() { return BrowserApi.create(streamInfo, false); });
201 } 201 }
202 202
203 /** 203 /**
204 * Returns a promise that will resolve to a BrowserApi instance. 204 * Returns a promise that will resolve to a BrowserApi instance.
205 * @return {Promise<BrowserApi>} A promise to a BrowserApi instance for the 205 * @return {Promise<BrowserApi>} A promise to a BrowserApi instance for the
206 * current environment. 206 * current environment.
207 */ 207 */
208 function createBrowserApi() { 208 function createBrowserApi() {
209 if (window.location.search) 209 if (location.search && location.ancestorOrigins[0] === 'chrome://print')
raymes 2016/10/11 06:24:44 Do we need the window.location.search check too?
robwu 2016/10/11 21:05:38 Yes. When loaded inside the plugin location.ancest
210 return createBrowserApiForStandaloneExtension(); 210 return createBrowserApiForStandaloneExtension();
211 211
212 return createBrowserApiForMimeHandlerView(); 212 return createBrowserApiForMimeHandlerView();
213 } 213 }
OLDNEW
« 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