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

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

Issue 346693002: Revert 278043 "Re-enable PDFExtensionTest.BasicPlugin" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/chrome/browser/resources/pdf/pdf_extension_test.cc » ('j') | 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 <include src="../../../../ui/webui/resources/js/util.js"> 7 <include src="../../../../ui/webui/resources/js/util.js">
8 <include src="pdf_scripting_api.js"> 8 <include src="pdf_scripting_api.js">
9 <include src="viewport.js"> 9 <include src="viewport.js">
10 10
(...skipping 17 matching lines...) Expand all
28 * The minimum number of pixels to offset the toolbar by from the bottom and 28 * The minimum number of pixels to offset the toolbar by from the bottom and
29 * right side of the screen. 29 * right side of the screen.
30 */ 30 */
31 PDFViewer.MIN_TOOLBAR_OFFSET = 15; 31 PDFViewer.MIN_TOOLBAR_OFFSET = 15;
32 32
33 /** 33 /**
34 * Creates a new PDFViewer. There should only be one of these objects per 34 * Creates a new PDFViewer. There should only be one of these objects per
35 * document. 35 * document.
36 */ 36 */
37 function PDFViewer() { 37 function PDFViewer() {
38 this.loaded = false;
39
40 // The sizer element is placed behind the plugin element to cause scrollbars 38 // The sizer element is placed behind the plugin element to cause scrollbars
41 // to be displayed in the window. It is sized according to the document size 39 // to be displayed in the window. It is sized according to the document size
42 // of the pdf and zoom level. 40 // of the pdf and zoom level.
43 this.sizer_ = $('sizer'); 41 this.sizer_ = $('sizer');
44 this.toolbar_ = $('toolbar'); 42 this.toolbar_ = $('toolbar');
45 this.pageIndicator_ = $('page-indicator'); 43 this.pageIndicator_ = $('page-indicator');
46 this.progressBar_ = $('progress-bar'); 44 this.progressBar_ = $('progress-bar');
47 this.passwordScreen_ = $('password-screen'); 45 this.passwordScreen_ = $('password-screen');
48 this.passwordScreen_.addEventListener('password-submitted', 46 this.passwordScreen_.addEventListener('password-submitted',
49 this.onPasswordSubmitted_.bind(this)); 47 this.onPasswordSubmitted_.bind(this));
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Document load failed. 249 // Document load failed.
252 this.errorScreen_.style.visibility = 'visible'; 250 this.errorScreen_.style.visibility = 'visible';
253 this.sizer_.style.display = 'none'; 251 this.sizer_.style.display = 'none';
254 this.toolbar_.style.visibility = 'hidden'; 252 this.toolbar_.style.visibility = 'hidden';
255 if (this.passwordScreen_.active) { 253 if (this.passwordScreen_.active) {
256 this.passwordScreen_.deny(); 254 this.passwordScreen_.deny();
257 this.passwordScreen_.active = false; 255 this.passwordScreen_.active = false;
258 } 256 }
259 } else if (progress == 100) { 257 } else if (progress == 100) {
260 // Document load complete. 258 // Document load complete.
261 this.loaded = true;
262 var loadEvent = new Event('pdfload'); 259 var loadEvent = new Event('pdfload');
263 window.dispatchEvent(loadEvent); 260 window.dispatchEvent(loadEvent);
264 this.sendScriptingMessage_({ 261 this.sendScriptingMessage_({
265 type: 'documentLoaded' 262 type: 'documentLoaded'
266 }); 263 });
267 if (this.lastViewportPosition_) 264 if (this.lastViewportPosition_)
268 this.viewport_.position = this.lastViewportPosition_; 265 this.viewport_.position = this.lastViewportPosition_;
269 } 266 }
270 }, 267 },
271 268
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 475
479 /** 476 /**
480 * @type {Viewport} the viewport of the PDF viewer. 477 * @type {Viewport} the viewport of the PDF viewer.
481 */ 478 */
482 get viewport() { 479 get viewport() {
483 return this.viewport_; 480 return this.viewport_;
484 } 481 }
485 }; 482 };
486 483
487 var viewer = new PDFViewer(); 484 var viewer = new PDFViewer();
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/browser/resources/pdf/pdf_extension_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698