| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // NOTE: The plugin's 'id' field must be set to 'plugin' since | 83 // NOTE: The plugin's 'id' field must be set to 'plugin' since |
| 84 // chrome/renderer/printing/print_web_view_helper.cc actually references it. | 84 // chrome/renderer/printing/print_web_view_helper.cc actually references it. |
| 85 this.plugin_.id = 'plugin'; | 85 this.plugin_.id = 'plugin'; |
| 86 this.plugin_.type = 'application/x-google-chrome-pdf'; | 86 this.plugin_.type = 'application/x-google-chrome-pdf'; |
| 87 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this), | 87 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this), |
| 88 false); | 88 false); |
| 89 this.plugin_.style.height = | 89 this.plugin_.style.height = |
| 90 (window.innerHeight - this.toolbarHeight_) + 'px'; | 90 (window.innerHeight - this.toolbarHeight_) + 'px'; |
| 91 this.plugin_.style.width = window.innerWidth + 'px'; | 91 this.plugin_.style.width = window.innerWidth + 'px'; |
| 92 | 92 |
| 93 this.plugin_.setAttribute('is-material', this.isMaterial_); |
| 94 |
| 93 // Handle scripting messages from outside the extension that wish to interact | 95 // Handle scripting messages from outside the extension that wish to interact |
| 94 // with it. We also send a message indicating that extension has loaded and | 96 // with it. We also send a message indicating that extension has loaded and |
| 95 // is ready to receive messages. | 97 // is ready to receive messages. |
| 96 window.addEventListener('message', this.handleScriptingMessage.bind(this), | 98 window.addEventListener('message', this.handleScriptingMessage.bind(this), |
| 97 false); | 99 false); |
| 98 | 100 |
| 99 document.title = getFilenameFromURL(this.streamDetails_.originalUrl); | 101 document.title = getFilenameFromURL(this.streamDetails_.originalUrl); |
| 100 if (this.isMaterial_) | 102 if (this.isMaterial_) |
| 101 $('title').textContent = document.title; | 103 $('title').textContent = document.title; |
| 102 this.plugin_.setAttribute('src', this.streamDetails_.originalUrl); | 104 this.plugin_.setAttribute('src', this.streamDetails_.originalUrl); |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 * Each bookmark is an Object containing a: | 682 * Each bookmark is an Object containing a: |
| 681 * - title | 683 * - title |
| 682 * - page (optional) | 684 * - page (optional) |
| 683 * - array of children (themselves bookmarks) | 685 * - array of children (themselves bookmarks) |
| 684 * @type {Array} the top-level bookmarks of the PDF. | 686 * @type {Array} the top-level bookmarks of the PDF. |
| 685 */ | 687 */ |
| 686 get bookmarks() { | 688 get bookmarks() { |
| 687 return this.bookmarks_; | 689 return this.bookmarks_; |
| 688 } | 690 } |
| 689 }; | 691 }; |
| OLD | NEW |