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

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

Issue 1085483002: Revert of Use custom scrollbars for print preview on non-retina mac displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
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 /** 7 /**
8 * Global PDFViewer object, accessible for testing. 8 * Global PDFViewer object, accessible for testing.
9 * @type Object 9 * @type Object
10 */ 10 */
(...skipping 24 matching lines...) Expand all
35 function initViewer(streamDetails) { 35 function initViewer(streamDetails) {
36 // PDFViewer will handle any messages after it is created. 36 // PDFViewer will handle any messages after it is created.
37 window.removeEventListener('message', handleScriptingMessage, false); 37 window.removeEventListener('message', handleScriptingMessage, false);
38 viewer = new PDFViewer(streamDetails); 38 viewer = new PDFViewer(streamDetails);
39 while (pendingMessages.length > 0) 39 while (pendingMessages.length > 0)
40 viewer.handleScriptingMessage(pendingMessages.shift()); 40 viewer.handleScriptingMessage(pendingMessages.shift());
41 } 41 }
42 42
43 function generateStreamDetailsAndInitViewer() { 43 function generateStreamDetailsAndInitViewer() {
44 var url = window.location.search.substring(1); 44 var url = window.location.search.substring(1);
45
46 // Hack to enable custom scrollbars for print preview on non-retina mac
47 // displays. Remove after crbug.com/466039 is fixed.
48 if (url.indexOf(IS_MAC_PARAM) === 0) {
49 url = url.substring(IS_MAC_PARAM.length);
50 var link = document.createElement('link');
51 link.rel = 'stylesheet';
52 link.type = 'text/css';
53 link.href = 'scrollbars_mac.css';
54 document.getElementsByTagName('head')[0].appendChild(link);
55 }
56
57 var streamDetails = { 45 var streamDetails = {
58 streamUrl: url, 46 streamUrl: url,
59 originalUrl: url, 47 originalUrl: url,
60 responseHeaders: '', 48 responseHeaders: '',
61 embedded: window.parent != window, 49 embedded: window.parent != window,
62 tabId: -1 50 tabId: -1
63 }; 51 };
64 if (!chrome.tabs) { 52 if (!chrome.tabs) {
65 initViewer(streamDetails); 53 initViewer(streamDetails);
66 return; 54 return;
(...skipping 21 matching lines...) Expand all
88 76
89 // If the viewer is started from the browser plugin, getStreamInfo will 77 // If the viewer is started from the browser plugin, getStreamInfo will
90 // return the details of the stream. 78 // return the details of the stream.
91 chrome.mimeHandlerPrivate.getStreamInfo(function(streamDetails) { 79 chrome.mimeHandlerPrivate.getStreamInfo(function(streamDetails) {
92 initViewer(streamDetails); 80 initViewer(streamDetails);
93 }); 81 });
94 }; 82 };
95 83
96 main(); 84 main();
97 })(); 85 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/component_extension_resources.grd ('k') | chrome/browser/resources/pdf/pdf_scripting_api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698