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

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: Rebasing 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..e604db0e3e07ea5e31b39cf8dcb9ced2b1c991ba 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;
+ $('custom-message-with-dots').hidden = false;
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 currently displayed.
+ */
+function hideOverlayLayer() {
+ if (hasPendingPrintDocumentRequest)
+ 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').hidden = true;
$('overlay-layer').removeEventListener('webkitTransitionEnd',
loadingAnimationCleanup);
}
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/browser/ui/webui/print_preview_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698