OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'strict'; | 6 'strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Creates a PreviewArea object. It represents the area where the preview | 9 * Creates a PreviewArea object. It represents the area where the preview |
10 * document is displayed. | 10 * document is displayed. |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 showCustomMessage: function(message) { | 188 showCustomMessage: function(message) { |
189 this.customMessageWithDots_.innerHTML = message + | 189 this.customMessageWithDots_.innerHTML = message + |
190 this.dancingDotsText.innerHTML; | 190 this.dancingDotsText.innerHTML; |
191 this.customMessageWithDots_.hidden = false; | 191 this.customMessageWithDots_.hidden = false; |
192 if (this.pdfPlugin_) | 192 if (this.pdfPlugin_) |
193 this.pdfPlugin_.classList.add('invisible'); | 193 this.pdfPlugin_.classList.add('invisible'); |
194 this.overlayLayer.classList.remove('invisible'); | 194 this.overlayLayer.classList.remove('invisible'); |
195 }, | 195 }, |
196 | 196 |
197 /** | 197 /** |
| 198 * Clears the custom message with dots animation. |
| 199 */ |
| 200 clearCustomMessageWithDots: function() { |
| 201 this.customMessageWithDots_.innerHTML = ''; |
| 202 this.customMessageWithDots_.hidden = true; |
| 203 }, |
| 204 |
| 205 /** |
198 * Display an error message in the center of the preview area. | 206 * Display an error message in the center of the preview area. |
199 * @param {string} errorMessage The error message to be displayed. | 207 * @param {string} errorMessage The error message to be displayed. |
200 */ | 208 */ |
201 displayErrorMessageAndNotify: function(errorMessage) { | 209 displayErrorMessageAndNotify: function(errorMessage) { |
202 this.overlayLayer.classList.remove('invisible'); | 210 this.overlayLayer.classList.remove('invisible'); |
203 this.customMessage_.textContent = errorMessage; | 211 this.customMessage_.textContent = errorMessage; |
204 this.customMessage_.hidden = false; | 212 this.customMessage_.hidden = false; |
205 this.customMessageWithDots_.innerHTML = ''; | 213 this.customMessageWithDots_.innerHTML = ''; |
206 this.customMessageWithDots_.hidden = true; | 214 this.customMessageWithDots_.hidden = true; |
207 if (this.pdfPlugin_) { | 215 if (this.pdfPlugin_) { |
(...skipping 12 matching lines...) Expand all Loading... |
220 * button is clicked. | 228 * button is clicked. |
221 */ | 229 */ |
222 displayErrorMessageWithButtonAndNotify: function( | 230 displayErrorMessageWithButtonAndNotify: function( |
223 errorMessage, buttonText, buttonListener) { | 231 errorMessage, buttonText, buttonListener) { |
224 this.errorButton.disabled = false; | 232 this.errorButton.disabled = false; |
225 this.errorButton.textContent = buttonText; | 233 this.errorButton.textContent = buttonText; |
226 this.errorButton.onclick = buttonListener; | 234 this.errorButton.onclick = buttonListener; |
227 this.errorButton.hidden = false; | 235 this.errorButton.hidden = false; |
228 $('system-dialog-throbber').hidden = true; | 236 $('system-dialog-throbber').hidden = true; |
229 $('native-print-dialog-throbber').hidden = true; | 237 $('native-print-dialog-throbber').hidden = true; |
| 238 if (cr.isMac) |
| 239 $('open-preview-app-throbber').hidden = true; |
230 this.displayErrorMessageAndNotify(errorMessage); | 240 this.displayErrorMessageAndNotify(errorMessage); |
231 } | 241 } |
232 }; | 242 }; |
233 | 243 |
234 return { | 244 return { |
235 PreviewArea: PreviewArea, | 245 PreviewArea: PreviewArea, |
236 }; | 246 }; |
237 }); | 247 }); |
OLD | NEW |