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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 this.plugin_.type = 'application/x-google-chrome-pdf'; | 106 this.plugin_.type = 'application/x-google-chrome-pdf'; |
107 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this), | 107 this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this), |
108 false); | 108 false); |
109 | 109 |
110 // Handle scripting messages from outside the extension that wish to interact | 110 // Handle scripting messages from outside the extension that wish to interact |
111 // with it. We also send a message indicating that extension has loaded and | 111 // with it. We also send a message indicating that extension has loaded and |
112 // is ready to receive messages. | 112 // is ready to receive messages. |
113 window.addEventListener('message', this.handleScriptingMessage.bind(this), | 113 window.addEventListener('message', this.handleScriptingMessage.bind(this), |
114 false); | 114 false); |
115 | 115 |
116 document.title = | 116 document.title = decodeURIComponent( |
117 getFilenameFromURL(this.browserApi_.getStreamInfo().originalUrl); | 117 getFilenameFromURL(this.browserApi_.getStreamInfo().originalUrl)); |
118 this.plugin_.setAttribute('src', | 118 this.plugin_.setAttribute('src', |
119 this.browserApi_.getStreamInfo().originalUrl); | 119 this.browserApi_.getStreamInfo().originalUrl); |
120 this.plugin_.setAttribute('stream-url', | 120 this.plugin_.setAttribute('stream-url', |
121 this.browserApi_.getStreamInfo().streamUrl); | 121 this.browserApi_.getStreamInfo().streamUrl); |
122 var headers = ''; | 122 var headers = ''; |
123 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { | 123 for (var header in this.browserApi_.getStreamInfo().responseHeaders) { |
124 headers += header + ': ' + | 124 headers += header + ': ' + |
125 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; | 125 this.browserApi_.getStreamInfo().responseHeaders[header] + '\n'; |
126 } | 126 } |
127 this.plugin_.setAttribute('headers', headers); | 127 this.plugin_.setAttribute('headers', headers); |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 * Each bookmark is an Object containing a: | 751 * Each bookmark is an Object containing a: |
752 * - title | 752 * - title |
753 * - page (optional) | 753 * - page (optional) |
754 * - array of children (themselves bookmarks) | 754 * - array of children (themselves bookmarks) |
755 * @type {Array} the top-level bookmarks of the PDF. | 755 * @type {Array} the top-level bookmarks of the PDF. |
756 */ | 756 */ |
757 get bookmarks() { | 757 get bookmarks() { |
758 return this.bookmarks_; | 758 return this.bookmarks_; |
759 } | 759 } |
760 }; | 760 }; |
OLD | NEW |