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

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

Issue 165813004: Implement "go to page" functionality in out of process PDF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | 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 (function() { 5 (function() {
6 'use strict'; 6 'use strict';
7 7
8 <include src="../../../../ui/webui/resources/js/util.js"></include> 8 <include src="../../../../ui/webui/resources/js/util.js"></include>
9 <include src="viewport.js"></include> 9 <include src="viewport.js"></include>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 viewerProgressBar.progress = progress; 42 viewerProgressBar.progress = progress;
43 if (progress == -1) { 43 if (progress == -1) {
44 // Document load failed. 44 // Document load failed.
45 sizer.style.display = 'none'; 45 sizer.style.display = 'none';
46 viewerToolbar.style.visibility = 'hidden'; 46 viewerToolbar.style.visibility = 'hidden';
47 } 47 }
48 } 48 }
49 49
50 // Called when a message is received from the plugin. 50 // Called when a message is received from the plugin.
51 function handleMessage(message) { 51 function handleMessage(message) {
52 if (message.data.type == 'documentDimensions') { 52 switch (message.data.type.toString()) {
53 documentDimensions = message.data; 53 case 'documentDimensions':
54 viewport.setDocumentDimensions(documentDimensions); 54 documentDimensions = message.data;
55 viewerToolbar.style.visibility = 'visible'; 55 viewport.setDocumentDimensions(documentDimensions);
56 viewerPageIndicator.initialFadeIn(); 56 viewerToolbar.style.visibility = 'visible';
57 viewerToolbar.initialFadeIn(); 57 viewerPageIndicator.initialFadeIn();
58 } else if (message.data.type == 'loadProgress') { 58 viewerToolbar.initialFadeIn();
59 updateProgress(message.data['progress']); 59 break;
60 case 'loadProgress':
61 updateProgress(message.data.progress);
62 break;
63 case 'goToPage':
64 viewport.goToPage(message.data.page);
65 break;
60 } 66 }
61 } 67 }
62 68
63 // Callback that's called when the viewport changes. 69 // Callback that's called when the viewport changes.
64 function viewportChangedCallback(zoom, 70 function viewportChangedCallback(zoom,
65 x, 71 x,
66 y, 72 y,
67 scrollbarWidth, 73 scrollbarWidth,
68 hasScrollbars, 74 hasScrollbars,
69 page) { 75 page) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 e.preventDefault(); 162 e.preventDefault();
157 } 163 }
158 return; 164 return;
159 } 165 }
160 }; 166 };
161 } 167 }
162 168
163 load(); 169 load();
164 170
165 })(); 171 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698