summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorabodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 18:46:24 +0000
committerabodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 18:46:24 +0000
commitdc34495526ba9bfbf410379cabd325e555f8b535 (patch)
treeaac4ad75b8ff5b204082c0b82d47d96c8484adbf
parent35600f9f98ac732e3333e014a50770fb21b3fe46 (diff)
downloadchromium_src-dc34495526ba9bfbf410379cabd325e555f8b535.zip
chromium_src-dc34495526ba9bfbf410379cabd325e555f8b535.tar.gz
chromium_src-dc34495526ba9bfbf410379cabd325e555f8b535.tar.bz2
Use displayname for printer name if it is set
BUG=http://code.google.com/p/chromium-os/issues/detail?id=24025 TEST=If the user sets the name of a printer in cloud print that name should be the displayed name of that printer in the print preview page. Review URL: http://codereview.chromium.org/8896014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114048 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/print_preview/print_preview_cloud.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/resources/print_preview/print_preview_cloud.js b/chrome/browser/resources/print_preview/print_preview_cloud.js
index 3c8a10f..90961ba 100644
--- a/chrome/browser/resources/print_preview/print_preview_cloud.js
+++ b/chrome/browser/resources/print_preview/print_preview_cloud.js
@@ -401,15 +401,20 @@ cr.define('cloudprint', function() {
if (!trackCloudPrinterAdded(printers[i]['id'])) {
break;
}
+ if (printers[i]['displayName'] && printers[i]['displayName'] != '')
+ var name = printers[i]['displayName'];
+ else
+ var name = printers[i]['name'];
+
var option = addDestinationListOptionAtPosition(
lastCloudPrintOptionPos++,
- printers[i]['name'],
+ name,
printers[i]['id'],
- printers[i]['name'] == defaultOrLastUsedPrinterName,
+ name == defaultOrLastUsedPrinterName,
false,
false);
cloudprint.setCloudPrint(option,
- printers[i]['name'],
+ name,
printers[i]['id']);
}
}