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

Unified Diff: chrome/browser/resources/local_discovery/local_discovery.js

Issue 284543002: Display different icons for different device types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mon 05/12/2014 14:15:39.40 Created 6 years, 7 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
Index: chrome/browser/resources/local_discovery/local_discovery.js
diff --git a/chrome/browser/resources/local_discovery/local_discovery.js b/chrome/browser/resources/local_discovery/local_discovery.js
index 33d8783bb5dae29d16173ee68b16aa338229b371..cbe78042764db7c5cc31aa9c9f70839732cd96c5 100644
--- a/chrome/browser/resources/local_discovery/local_discovery.js
+++ b/chrome/browser/resources/local_discovery/local_discovery.js
@@ -100,6 +100,7 @@ cr.define('local_discovery', function() {
this.domElement,
this.info.human_readable_name,
this.info.description,
+ this.info.type,
loadTimeData.getString('serviceRegister'),
this.showRegister.bind(this));
@@ -183,17 +184,20 @@ cr.define('local_discovery', function() {
* @param {HTMLElement} device_dom_element Element to be filled.
* @param {string} name Name of device.
* @param {string} description Description of device.
+ * @param {string} type Type of device.
* @param {string} button_text Text to appear on button.
* @param {function()} button_action Action for button.
* @return {HTMLElement} The button (for enabling/disabling/rebinding)
*/
function fillDeviceDescription(device_dom_element,
- name,
- description,
- button_text,
- button_action) {
+ name,
+ description,
+ type,
+ button_text,
+ button_action) {
device_dom_element.classList.add('device');
- device_dom_element.classList.add('printer');
+ if (type == 'printer')
+ device_dom_element.classList.add('printer');
var deviceInfo = document.createElement('div');
deviceInfo.className = 'device-info';
@@ -325,13 +329,13 @@ cr.define('local_discovery', function() {
var description;
if (device.description == '') {
- description = loadTimeData.getString('noDescription');
- } else {
- description = device.description;
- }
+ description = loadTimeData.getString('noDescription');
+ } else {
+ description = device.description;
+ }
fillDeviceDescription(devicesDomElement, device.display_name,
- description, 'Manage' /*Localize*/,
+ description, device.type, 'Manage' /*Localize*/,
manageCloudDevice.bind(null, device.id));
return devicesDomElement;
}

Powered by Google App Engine
This is Rietveld 408576698