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

Unified Diff: chrome/browser/resources/print_preview/previewarea/preview_area.js

Issue 2741483002: Check for RPCS printers and return error if Win8+ (Closed)
Patch Set: Format Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/previewarea/preview_area.js
diff --git a/chrome/browser/resources/print_preview/previewarea/preview_area.js b/chrome/browser/resources/print_preview/previewarea/preview_area.js
index ca553a7c7a1102a1c5cf4aee36ab9b713ccaa22f..522995c805f874bd412335e43f55aa41d89a7a4c 100644
--- a/chrome/browser/resources/print_preview/previewarea/preview_area.js
+++ b/chrome/browser/resources/print_preview/previewarea/preview_area.js
@@ -602,14 +602,21 @@ cr.define('print_preview', function() {
},
/**
- * Called when the generation of a preview fails. Shows an error message.
- * @private
+ * Cancels the timeout so that an error message can be shown.
*/
- onPreviewGenerationFail_: function() {
+ cancelTimeout: function() {
if (this.loadingTimeout_) {
clearTimeout(this.loadingTimeout_);
this.loadingTimeout_ = null;
}
+ },
+
+ /**
+ * Called when the generation of a preview fails. Shows an error message.
+ * @private
+ */
+ onPreviewGenerationFail_: function() {
+ this.cancelTimeout();
this.showMessage_(PreviewArea.MessageId_.PREVIEW_FAILED);
cr.dispatchSimpleEvent(
this, PreviewArea.EventType.PREVIEW_GENERATION_FAIL);
@@ -622,11 +629,7 @@ cr.define('print_preview', function() {
* @private
*/
onPluginLoad_: function() {
- if (this.loadingTimeout_) {
- clearTimeout(this.loadingTimeout_);
- this.loadingTimeout_ = null;
- }
-
+ this.cancelTimeout();
this.setOverlayVisible_(false);
this.isPluginReloaded_ = true;
this.dispatchPreviewGenerationDoneIfReady_();
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698