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

Unified Diff: chrome/browser/resources/print_preview/data/destination_store.js

Issue 2509983006: Print Preview: Fix handling of printers without capabilities. (Closed)
Patch Set: Created 4 years, 1 month 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/ui/webui/print_preview/printer_capabilities.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/data/destination_store.js
diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js
index a96778fcea849646b4df90b85660bf85ce4884fd..52a1d9cf1f6c1f95c38c63d22d4eb4836b24b110 100644
--- a/chrome/browser/resources/print_preview/data/destination_store.js
+++ b/chrome/browser/resources/print_preview/data/destination_store.js
@@ -509,6 +509,9 @@ cr.define('print_preview', function() {
* @private
*/
DestinationStore.localizeCapabilities_ = function(capabilities) {
+ if (!capabilities.printer)
+ return capabilities;
+
var mediaSize = capabilities.printer.media_size;
if (!mediaSize)
return capabilities;
@@ -545,6 +548,9 @@ cr.define('print_preview', function() {
* @private
*/
DestinationStore.sortMediaSizes_ = function(capabilities) {
+ if (!capabilities.printer)
+ return capabilities;
+
var mediaSize = capabilities.printer.media_size;
if (!mediaSize)
return capabilities;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/print_preview/printer_capabilities.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698