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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 this.toolbar_.hideDropdowns.bind(this.toolbar_)); | 230 this.toolbar_.hideDropdowns.bind(this.toolbar_)); |
231 | 231 |
232 this.toolbar_.docTitle = | 232 this.toolbar_.docTitle = |
233 getFilenameFromURL(this.originalUrl_); | 233 getFilenameFromURL(this.originalUrl_); |
234 } | 234 } |
235 | 235 |
236 document.body.addEventListener('change-page', function(e) { | 236 document.body.addEventListener('change-page', function(e) { |
237 this.viewport_.goToPage(e.detail.page); | 237 this.viewport_.goToPage(e.detail.page); |
238 }.bind(this)); | 238 }.bind(this)); |
239 | 239 |
| 240 document.body.addEventListener('navigate', function(e) { |
| 241 this.navigator_.navigate(e.detail.uri, e.detail.newtab); |
| 242 }.bind(this)); |
| 243 |
240 this.toolbarManager_ = | 244 this.toolbarManager_ = |
241 new ToolbarManager(window, this.toolbar_, this.zoomToolbar_); | 245 new ToolbarManager(window, this.toolbar_, this.zoomToolbar_); |
242 | 246 |
243 // Set up the ZoomManager. | 247 // Set up the ZoomManager. |
244 this.zoomManager_ = new ZoomManager( | 248 this.zoomManager_ = new ZoomManager( |
245 this.viewport_, this.browserApi_.setZoom.bind(this.browserApi_), | 249 this.viewport_, this.browserApi_.setZoom.bind(this.browserApi_), |
246 this.browserApi_.getInitialZoom()); | 250 this.browserApi_.getInitialZoom()); |
247 this.browserApi_.addZoomEventListener( | 251 this.browserApi_.addZoomEventListener( |
248 this.zoomManager_.onBrowserZoomChange.bind(this.zoomManager_)); | 252 this.zoomManager_.onBrowserZoomChange.bind(this.zoomManager_)); |
249 | 253 |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 * Each bookmark is an Object containing a: | 878 * Each bookmark is an Object containing a: |
875 * - title | 879 * - title |
876 * - page (optional) | 880 * - page (optional) |
877 * - array of children (themselves bookmarks) | 881 * - array of children (themselves bookmarks) |
878 * @type {Array} the top-level bookmarks of the PDF. | 882 * @type {Array} the top-level bookmarks of the PDF. |
879 */ | 883 */ |
880 get bookmarks() { | 884 get bookmarks() { |
881 return this.bookmarks_; | 885 return this.bookmarks_; |
882 } | 886 } |
883 }; | 887 }; |
OLD | NEW |