Chromium Code Reviews

Side by Side Diff: chrome/browser/resources/print_preview/preview_area.js

Issue 8425008: PrintPreview:[MAC] Added "Open PDF In Preview" option to open the pdf in native preview app. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
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...)
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...)
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 $('open-preview-app-throbber').hidden = true;
230 this.displayErrorMessageAndNotify(errorMessage); 239 this.displayErrorMessageAndNotify(errorMessage);
231 } 240 }
232 }; 241 };
233 242
234 return { 243 return {
235 PreviewArea: PreviewArea, 244 PreviewArea: PreviewArea,
236 }; 245 };
237 }); 246 });
OLDNEW

Powered by Google App Engine