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

Unified Diff: chrome/browser/resources/print_preview/print_preview_animations.js

Issue 7792085: Print Preview: Handling pending print to pdf requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updating unit test, adding comments Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/print_preview_animations.js
diff --git a/chrome/browser/resources/print_preview/print_preview_animations.js b/chrome/browser/resources/print_preview/print_preview_animations.js
index 7d8743315ee1fc7456094606eb12c8d850f94667..7f3c8b035866cebae56f4ce85674ed26597881ed 100644
--- a/chrome/browser/resources/print_preview/print_preview_animations.js
+++ b/chrome/browser/resources/print_preview/print_preview_animations.js
@@ -78,15 +78,33 @@ function fadeInOutCleanup(animationName) {
animEl.parentNode.removeChild(animEl);
}
-function showLoadingAnimation() {
- $('dancing-dots-text').classList.remove('hidden');
+/**
+ * Displays |message| followed by three dancing dots animation.
+ */
+function showCustomMessage(message) {
+ $('custom-message-with-dots').innerHTML = message +
+ $('dancing-dots-text').innerHTML;
arv (Not doing code reviews) 2011/09/07 21:53:52 No, don't use innerHTML like this. There is no poi
dpapad 2011/09/08 03:29:20 This results in a larger spacing between the danci
+ $('custom-message-with-dots').classList.remove('hidden');
arv (Not doing code reviews) 2011/09/07 21:53:52 hidden = false
dpapad 2011/09/08 03:29:20 Done.
var pdfViewer = $('pdf-viewer');
if (pdfViewer)
pdfViewer.classList.add('invisible');
$('overlay-layer').classList.remove('invisible');
}
-function hideLoadingAnimation() {
+/**
+ * Displays the "Preview loading..." animation.
+ */
+function showLoadingAnimation() {
+ showCustomMessage(localStrings.getString('loading'));
+}
+
+/**
+ * Hides the |overlay-layer| and any messages curretnly displayed.
+ */
+function hideOverlayLayer() {
+ if (hasPendingPrintToPdfRequest)
vandebo (ex-Chrome) 2011/09/07 21:38:19 It's not clear to me if this is needed. As soon a
dpapad 2011/09/07 23:42:39 This is addressing a corner case, when the user ha
+ return;
+
var overlayLayer = $('overlay-layer');
overlayLayer.addEventListener('webkitTransitionEnd', loadingAnimationCleanup);
var pdfViewer = $('pdf-viewer');
@@ -96,7 +114,7 @@ function hideLoadingAnimation() {
}
function loadingAnimationCleanup() {
- $('dancing-dots-text').classList.add('hidden');
+ $('custom-message-with-dots').classList.add('hidden');
$('overlay-layer').removeEventListener('webkitTransitionEnd',
loadingAnimationCleanup);
}

Powered by Google App Engine
This is Rietveld 408576698