| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 function PDFViewer(browserApi) { | 94 function PDFViewer(browserApi) { |
| 95 this.browserApi_ = browserApi; | 95 this.browserApi_ = browserApi; |
| 96 this.originalUrl_ = this.browserApi_.getStreamInfo().originalUrl; | 96 this.originalUrl_ = this.browserApi_.getStreamInfo().originalUrl; |
| 97 this.loadState_ = LoadState.LOADING; | 97 this.loadState_ = LoadState.LOADING; |
| 98 this.parentWindow_ = null; | 98 this.parentWindow_ = null; |
| 99 this.parentOrigin_ = null; | 99 this.parentOrigin_ = null; |
| 100 this.isFormFieldFocused_ = false; | 100 this.isFormFieldFocused_ = false; |
| 101 | 101 |
| 102 this.delayedScriptingMessages_ = []; | 102 this.delayedScriptingMessages_ = []; |
| 103 | 103 |
| 104 this.isPrintPreview_ = this.originalUrl_.startsWith('chrome://print'); | 104 this.isPrintPreview_ = location.origin === 'chrome://print'; |
| 105 | 105 |
| 106 // Parse open pdf parameters. | 106 // Parse open pdf parameters. |
| 107 this.paramsParser_ = | 107 this.paramsParser_ = |
| 108 new OpenPDFParamsParser(this.getNamedDestination_.bind(this)); | 108 new OpenPDFParamsParser(this.getNamedDestination_.bind(this)); |
| 109 var toolbarEnabled = | 109 var toolbarEnabled = |
| 110 this.paramsParser_.getUiUrlParams(this.originalUrl_).toolbar && | 110 this.paramsParser_.getUiUrlParams(this.originalUrl_).toolbar && |
| 111 !this.isPrintPreview_; | 111 !this.isPrintPreview_; |
| 112 | 112 |
| 113 // The sizer element is placed behind the plugin element to cause scrollbars | 113 // The sizer element is placed behind the plugin element to cause scrollbars |
| 114 // to be displayed in the window. It is sized according to the document size | 114 // to be displayed in the window. It is sized according to the document size |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 * Each bookmark is an Object containing a: | 859 * Each bookmark is an Object containing a: |
| 860 * - title | 860 * - title |
| 861 * - page (optional) | 861 * - page (optional) |
| 862 * - array of children (themselves bookmarks) | 862 * - array of children (themselves bookmarks) |
| 863 * @type {Array} the top-level bookmarks of the PDF. | 863 * @type {Array} the top-level bookmarks of the PDF. |
| 864 */ | 864 */ |
| 865 get bookmarks() { | 865 get bookmarks() { |
| 866 return this.bookmarks_; | 866 return this.bookmarks_; |
| 867 } | 867 } |
| 868 }; | 868 }; |
| OLD | NEW |