| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 this.browserApi_.getInitialZoom()); | 239 this.browserApi_.getInitialZoom()); |
| 240 this.viewport_.zoomManager = this.zoomManager_; | 240 this.viewport_.zoomManager = this.zoomManager_; |
| 241 this.browserApi_.addZoomEventListener( | 241 this.browserApi_.addZoomEventListener( |
| 242 this.zoomManager_.onBrowserZoomChange.bind(this.zoomManager_)); | 242 this.zoomManager_.onBrowserZoomChange.bind(this.zoomManager_)); |
| 243 | 243 |
| 244 // Setup the keyboard event listener. | 244 // Setup the keyboard event listener. |
| 245 document.addEventListener('keydown', this.handleKeyEvent_.bind(this)); | 245 document.addEventListener('keydown', this.handleKeyEvent_.bind(this)); |
| 246 document.addEventListener('mousemove', this.handleMouseEvent_.bind(this)); | 246 document.addEventListener('mousemove', this.handleMouseEvent_.bind(this)); |
| 247 document.addEventListener('mouseout', this.handleMouseEvent_.bind(this)); | 247 document.addEventListener('mouseout', this.handleMouseEvent_.bind(this)); |
| 248 | 248 |
| 249 var isInTab = this.browserApi_.getStreamInfo().tabId != -1; | 249 var tabId = this.browserApi_.getStreamInfo().tabId; |
| 250 this.navigator_ = new Navigator( | 250 this.navigator_ = new Navigator( |
| 251 this.originalUrl_, this.viewport_, this.paramsParser_, | 251 this.originalUrl_, this.viewport_, this.paramsParser_, |
| 252 new NavigatorDelegate(isInTab)); | 252 new NavigatorDelegate(tabId)); |
| 253 this.viewportScroller_ = | 253 this.viewportScroller_ = |
| 254 new ViewportScroller(this.viewport_, this.plugin_, window); | 254 new ViewportScroller(this.viewport_, this.plugin_, window); |
| 255 | 255 |
| 256 // Request translated strings. | 256 // Request translated strings. |
| 257 chrome.resourcesPrivate.getStrings('pdf', this.handleStrings_.bind(this)); | 257 chrome.resourcesPrivate.getStrings('pdf', this.handleStrings_.bind(this)); |
| 258 } | 258 } |
| 259 | 259 |
| 260 PDFViewer.prototype = { | 260 PDFViewer.prototype = { |
| 261 /** | 261 /** |
| 262 * @private | 262 * @private |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 * Each bookmark is an Object containing a: | 923 * Each bookmark is an Object containing a: |
| 924 * - title | 924 * - title |
| 925 * - page (optional) | 925 * - page (optional) |
| 926 * - array of children (themselves bookmarks) | 926 * - array of children (themselves bookmarks) |
| 927 * @type {Array} the top-level bookmarks of the PDF. | 927 * @type {Array} the top-level bookmarks of the PDF. |
| 928 */ | 928 */ |
| 929 get bookmarks() { | 929 get bookmarks() { |
| 930 return this.bookmarks_; | 930 return this.bookmarks_; |
| 931 } | 931 } |
| 932 }; | 932 }; |
| OLD | NEW |