OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
6 * Javascript for local_discovery.html, served from chrome://devices/ | 6 * Javascript for local_discovery.html, served from chrome://devices/ |
7 * This is used to show discoverable devices near the user as well as | 7 * This is used to show discoverable devices near the user as well as |
8 * cloud devices registered to them. | 8 * cloud devices registered to them. |
9 * | 9 * |
10 * The object defined in this javascript file listens for callbacks from the | 10 * The object defined in this javascript file listens for callbacks from the |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 * @param {string} description Description of device. | 111 * @param {string} description Description of device. |
112 * @param {string} button_text Text to appear on button. | 112 * @param {string} button_text Text to appear on button. |
113 * @param {function()} button_action Action for button. | 113 * @param {function()} button_action Action for button. |
114 */ | 114 */ |
115 function fillDeviceDescription(device_dom_element, | 115 function fillDeviceDescription(device_dom_element, |
116 name, | 116 name, |
117 description, | 117 description, |
118 button_text, | 118 button_text, |
119 button_action) { | 119 button_action) { |
120 device_dom_element.classList.add('device'); | 120 device_dom_element.classList.add('device'); |
| 121 device_dom_element.classList.add('printer'); |
121 | 122 |
122 var deviceInfo = document.createElement('div'); | 123 var deviceInfo = document.createElement('div'); |
123 deviceInfo.className = 'device-info'; | 124 deviceInfo.className = 'device-info'; |
124 device_dom_element.appendChild(deviceInfo); | 125 device_dom_element.appendChild(deviceInfo); |
125 | 126 |
126 var deviceName = document.createElement('h3'); | 127 var deviceName = document.createElement('h3'); |
127 deviceName.className = 'device-name'; | 128 deviceName.className = 'device-name'; |
128 deviceName.textContent = name; | 129 deviceName.textContent = name; |
129 deviceInfo.appendChild(deviceName); | 130 deviceInfo.appendChild(deviceName); |
130 | 131 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 360 |
360 return { | 361 return { |
361 onRegistrationSuccess: onRegistrationSuccess, | 362 onRegistrationSuccess: onRegistrationSuccess, |
362 onRegistrationFailed: onRegistrationFailed, | 363 onRegistrationFailed: onRegistrationFailed, |
363 onUnregisteredDeviceUpdate: onUnregisteredDeviceUpdate, | 364 onUnregisteredDeviceUpdate: onUnregisteredDeviceUpdate, |
364 onRegistrationConfirmedOnPrinter: onRegistrationConfirmedOnPrinter, | 365 onRegistrationConfirmedOnPrinter: onRegistrationConfirmedOnPrinter, |
365 onCloudDeviceListAvailable: onCloudDeviceListAvailable, | 366 onCloudDeviceListAvailable: onCloudDeviceListAvailable, |
366 onDeviceCacheFlushed: onDeviceCacheFlushed | 367 onDeviceCacheFlushed: onDeviceCacheFlushed |
367 }; | 368 }; |
368 }); | 369 }); |
OLD | NEW |