Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: chrome/browser/resources/pdf/pdf.js

Issue 2568903002: PDF viewer: Specify tabId when navigating with chrome.tabs.update. (Closed)
Patch Set: Fix nits. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/pdf/navigator.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/navigator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698