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

Side by Side Diff: components/dom_distiller/core/javascript/dom_distiller_viewer.js

Issue 1920563002: Only trigger navigation in distiller if in print preview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_distiller.cc ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This variable will be changed by iOS scripts. 5 // This variable will be changed by iOS scripts.
6 var distiller_on_ios = false; 6 var distiller_on_ios = false;
7 7
8 function addToPage(html) { 8 function addToPage(html) {
9 var div = document.createElement('div'); 9 var div = document.createElement('div');
10 div.innerHTML = html; 10 div.innerHTML = html;
(...skipping 25 matching lines...) Expand all
36 parent.replaceChild(container, placeholders[i]); 36 parent.replaceChild(container, placeholders[i]);
37 } 37 }
38 } 38 }
39 39
40 function showLoadingIndicator(isLastPage) { 40 function showLoadingIndicator(isLastPage) {
41 document.getElementById('loadingIndicator').className = 41 document.getElementById('loadingIndicator').className =
42 isLastPage ? 'hidden' : 'visible'; 42 isLastPage ? 'hidden' : 'visible';
43 // This function will be one of the last things to occur when a page is 43 // This function will be one of the last things to occur when a page is
44 // loaded. This is temporarily used to signal print preview to generate 44 // loaded. This is temporarily used to signal print preview to generate
45 // a PDF. 45 // a PDF.
46 if (isLastPage) { 46 if (isLastPage && typeof isPrintPreviewDistiller !== 'undefined'
47 && isPrintPreviewDistiller) {
47 setTimeout(function() { 48 setTimeout(function() {
48 window.location = window.location + "#loaded"; 49 window.location = window.location + "#loaded";
49 }, 0); 50 }, 0);
50 } 51 }
51 } 52 }
52 53
53 // Sets the title. 54 // Sets the title.
54 function setTitle(title) { 55 function setTitle(title) {
55 var holder = document.getElementById('titleHolder'); 56 var holder = document.getElementById('titleHolder');
56 57
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 clampedScale = scaling; 404 clampedScale = scaling;
404 restoreCenter(); 405 restoreCenter();
405 } 406 }
406 }; 407 };
407 }()); 408 }());
408 409
409 window.addEventListener('touchstart', pincher.handleTouchStart, false); 410 window.addEventListener('touchstart', pincher.handleTouchStart, false);
410 window.addEventListener('touchmove', pincher.handleTouchMove, false); 411 window.addEventListener('touchmove', pincher.handleTouchMove, false);
411 window.addEventListener('touchend', pincher.handleTouchEnd, false); 412 window.addEventListener('touchend', pincher.handleTouchEnd, false);
412 window.addEventListener('touchcancel', pincher.handleTouchCancel, false); 413 window.addEventListener('touchcancel', pincher.handleTouchCancel, false);
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_distiller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698