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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { | 195 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { |
196 headers += header + ': ' + | 196 headers += header + ': ' + |
197 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; | 197 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; |
198 } | 198 } |
199 this.plugin_.setAttribute('headers', headers); | 199 this.plugin_.setAttribute('headers', headers); |
200 | 200 |
201 var backgroundColor = PDFViewer.DARK_BACKGROUND_COLOR; | 201 var backgroundColor = PDFViewer.DARK_BACKGROUND_COLOR; |
202 this.plugin_.setAttribute('background-color', backgroundColor); | 202 this.plugin_.setAttribute('background-color', backgroundColor); |
203 this.plugin_.setAttribute('top-toolbar-height', topToolbarHeight); | 203 this.plugin_.setAttribute('top-toolbar-height', topToolbarHeight); |
204 | 204 |
205 if (!this.browserApi_.getStreamInfo().embedded) | 205 if (this.browserApi_.getStreamInfo().embedded) { |
206 this.plugin_.setAttribute('embedder-url', | |
raymes
2016/09/05 04:11:47
I think top-level-url may be more accurate here (t
Lei Zhang
2016/09/07 00:12:39
Done in all the places.
| |
207 this.browserApi_.getStreamInfo().tabUrl); | |
208 } else { | |
206 this.plugin_.setAttribute('full-frame', ''); | 209 this.plugin_.setAttribute('full-frame', ''); |
raymes
2016/09/05 04:11:47
optional: We could merge this with top-level-url a
Lei Zhang
2016/09/07 00:12:38
Can we ever be embedded, but have an empty top-lev
| |
210 } | |
207 document.body.appendChild(this.plugin_); | 211 document.body.appendChild(this.plugin_); |
208 | 212 |
209 // Setup the button event listeners. | 213 // Setup the button event listeners. |
210 this.zoomToolbar_ = $('zoom-toolbar'); | 214 this.zoomToolbar_ = $('zoom-toolbar'); |
211 this.zoomToolbar_.addEventListener('fit-to-width', | 215 this.zoomToolbar_.addEventListener('fit-to-width', |
212 this.viewport_.fitToWidth.bind(this.viewport_)); | 216 this.viewport_.fitToWidth.bind(this.viewport_)); |
213 this.zoomToolbar_.addEventListener('fit-to-page', | 217 this.zoomToolbar_.addEventListener('fit-to-page', |
214 this.fitToPage_.bind(this)); | 218 this.fitToPage_.bind(this)); |
215 this.zoomToolbar_.addEventListener('zoom-in', | 219 this.zoomToolbar_.addEventListener('zoom-in', |
216 this.viewport_.zoomIn.bind(this.viewport_)); | 220 this.viewport_.zoomIn.bind(this.viewport_)); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
880 * Each bookmark is an Object containing a: | 884 * Each bookmark is an Object containing a: |
881 * - title | 885 * - title |
882 * - page (optional) | 886 * - page (optional) |
883 * - array of children (themselves bookmarks) | 887 * - array of children (themselves bookmarks) |
884 * @type {Array} the top-level bookmarks of the PDF. | 888 * @type {Array} the top-level bookmarks of the PDF. |
885 */ | 889 */ |
886 get bookmarks() { | 890 get bookmarks() { |
887 return this.bookmarks_; | 891 return this.bookmarks_; |
888 } | 892 } |
889 }; | 893 }; |
OLD | NEW |