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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { | 165 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { |
166 headers += header + ': ' + | 166 headers += header + ': ' + |
167 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; | 167 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; |
168 } | 168 } |
169 this.plugin_.setAttribute('headers', headers); | 169 this.plugin_.setAttribute('headers', headers); |
170 | 170 |
171 var backgroundColor = PDFViewer.DARK_BACKGROUND_COLOR; | 171 var backgroundColor = PDFViewer.DARK_BACKGROUND_COLOR; |
172 this.plugin_.setAttribute('background-color', backgroundColor); | 172 this.plugin_.setAttribute('background-color', backgroundColor); |
173 this.plugin_.setAttribute('top-toolbar-height', topToolbarHeight); | 173 this.plugin_.setAttribute('top-toolbar-height', topToolbarHeight); |
174 | 174 |
175 if (!this.browserApi_.getStreamInfo().embedded) | 175 if (this.browserApi_.getStreamInfo().embedded) { |
| 176 this.plugin_.setAttribute('top-level-url', |
| 177 this.browserApi_.getStreamInfo().tabUrl); |
| 178 } else { |
176 this.plugin_.setAttribute('full-frame', ''); | 179 this.plugin_.setAttribute('full-frame', ''); |
| 180 } |
177 document.body.appendChild(this.plugin_); | 181 document.body.appendChild(this.plugin_); |
178 | 182 |
179 // Setup the button event listeners. | 183 // Setup the button event listeners. |
180 this.zoomToolbar_ = $('zoom-toolbar'); | 184 this.zoomToolbar_ = $('zoom-toolbar'); |
181 this.zoomToolbar_.addEventListener('fit-to-width', | 185 this.zoomToolbar_.addEventListener('fit-to-width', |
182 this.viewport_.fitToWidth.bind(this.viewport_)); | 186 this.viewport_.fitToWidth.bind(this.viewport_)); |
183 this.zoomToolbar_.addEventListener('fit-to-page', | 187 this.zoomToolbar_.addEventListener('fit-to-page', |
184 this.fitToPage_.bind(this)); | 188 this.fitToPage_.bind(this)); |
185 this.zoomToolbar_.addEventListener('zoom-in', | 189 this.zoomToolbar_.addEventListener('zoom-in', |
186 this.viewport_.zoomIn.bind(this.viewport_)); | 190 this.viewport_.zoomIn.bind(this.viewport_)); |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 * Each bookmark is an Object containing a: | 859 * Each bookmark is an Object containing a: |
856 * - title | 860 * - title |
857 * - page (optional) | 861 * - page (optional) |
858 * - array of children (themselves bookmarks) | 862 * - array of children (themselves bookmarks) |
859 * @type {Array} the top-level bookmarks of the PDF. | 863 * @type {Array} the top-level bookmarks of the PDF. |
860 */ | 864 */ |
861 get bookmarks() { | 865 get bookmarks() { |
862 return this.bookmarks_; | 866 return this.bookmarks_; |
863 } | 867 } |
864 }; | 868 }; |
OLD | NEW |