OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * @return {number} Width of a scrollbar in pixels | 8 * @return {number} Width of a scrollbar in pixels |
9 */ | 9 */ |
10 function getScrollbarWidth() { | 10 function getScrollbarWidth() { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 this.streamDetails_ = streamDetails; | 68 this.streamDetails_ = streamDetails; |
69 this.loaded_ = false; | 69 this.loaded_ = false; |
70 this.parentWindow_ = null; | 70 this.parentWindow_ = null; |
71 | 71 |
72 this.delayedScriptingMessages_ = []; | 72 this.delayedScriptingMessages_ = []; |
73 | 73 |
74 this.isPrintPreview_ = | 74 this.isPrintPreview_ = |
75 this.streamDetails_.originalUrl.indexOf('chrome://print') == 0; | 75 this.streamDetails_.originalUrl.indexOf('chrome://print') == 0; |
76 this.isMaterial_ = location.pathname.substring(1) === 'index-material.html'; | 76 this.isMaterial_ = location.pathname.substring(1) === 'index-material.html'; |
77 | 77 |
| 78 // Hack to enable custom scrollbars for print preview on non-retina mac |
| 79 // displays. Remove after crbug.com/466039 is fixed. |
| 80 if (this.isPrintPreview_) { |
| 81 var link = document.createElement('link'); |
| 82 link.rel = 'stylesheet'; |
| 83 link.type = 'text/css'; |
| 84 link.href = 'scrollbars-mac.css'; |
| 85 document.getElementsByTagName('head')[0].appendChild(link); |
| 86 } |
| 87 |
78 // The sizer element is placed behind the plugin element to cause scrollbars | 88 // The sizer element is placed behind the plugin element to cause scrollbars |
79 // to be displayed in the window. It is sized according to the document size | 89 // to be displayed in the window. It is sized according to the document size |
80 // of the pdf and zoom level. | 90 // of the pdf and zoom level. |
81 this.sizer_ = $('sizer'); | 91 this.sizer_ = $('sizer'); |
82 this.toolbar_ = $('toolbar'); | 92 this.toolbar_ = $('toolbar'); |
83 this.pageIndicator_ = $('page-indicator'); | 93 this.pageIndicator_ = $('page-indicator'); |
84 this.progressBar_ = $('progress-bar'); | 94 this.progressBar_ = $('progress-bar'); |
85 this.passwordScreen_ = $('password-screen'); | 95 this.passwordScreen_ = $('password-screen'); |
86 this.passwordScreen_.addEventListener('password-submitted', | 96 this.passwordScreen_.addEventListener('password-submitted', |
87 this.onPasswordSubmitted_.bind(this)); | 97 this.onPasswordSubmitted_.bind(this)); |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 * Each bookmark is an Object containing a: | 812 * Each bookmark is an Object containing a: |
803 * - title | 813 * - title |
804 * - page (optional) | 814 * - page (optional) |
805 * - array of children (themselves bookmarks) | 815 * - array of children (themselves bookmarks) |
806 * @type {Array} the top-level bookmarks of the PDF. | 816 * @type {Array} the top-level bookmarks of the PDF. |
807 */ | 817 */ |
808 get bookmarks() { | 818 get bookmarks() { |
809 return this.bookmarks_; | 819 return this.bookmarks_; |
810 } | 820 } |
811 }; | 821 }; |
OLD | NEW |