Index: chrome/browser/resources/print_preview/settings/destination_settings.js |
diff --git a/chrome/browser/resources/print_preview/settings/destination_settings.js b/chrome/browser/resources/print_preview/settings/destination_settings.js |
index 9c806fd204eb9dca72f8378d03fc9b77219e3027..ffc08939eb0d95548e33ab236084de36d1f7cf1b 100644 |
--- a/chrome/browser/resources/print_preview/settings/destination_settings.js |
+++ b/chrome/browser/resources/print_preview/settings/destination_settings.js |
@@ -59,6 +59,7 @@ cr.define('print_preview', function() { |
ICON_MOBILE_SHARED: 'destination-settings-icon-mobile-shared', |
LOCATION: 'destination-settings-location', |
NAME: 'destination-settings-name', |
+ STALE: 'stale', |
THOBBER_NAME: 'destination-throbber-name' |
}; |
@@ -115,15 +116,28 @@ cr.define('print_preview', function() { |
DestinationSettings.Classes_.ICON)[0]; |
iconEl.src = destination.iconUrl; |
+ var location = destination.location; |
var locationEl = this.getElement().getElementsByClassName( |
DestinationSettings.Classes_.LOCATION)[0]; |
- locationEl.textContent = destination.location; |
- locationEl.title = destination.location; |
- |
- setIsVisible(this.getElement().querySelector('.throbber-container'), |
- false); |
- setIsVisible( |
- this.getElement().querySelector('.destination-settings-box'), true); |
+ locationEl.textContent = location; |
+ locationEl.title = location; |
+ |
+ var offlineStatusText = destination.offlineStatusText; |
+ var offlineStatusEl = |
+ this.getChildElement('.destination-settings-offline-status'); |
+ offlineStatusEl.textContent = offlineStatusText; |
+ offlineStatusEl.title = offlineStatusText; |
+ |
+ var isOffline = destination.isOffline; |
+ var destinationSettingsBoxEl = |
+ this.getChildElement('.destination-settings-box'); |
+ destinationSettingsBoxEl.classList.toggle( |
+ DestinationSettings.Classes_.STALE, isOffline); |
+ setIsVisible(locationEl, !isOffline); |
+ setIsVisible(offlineStatusEl, isOffline); |
+ |
+ setIsVisible(this.getChildElement('.throbber-container'), false); |
+ setIsVisible(destinationSettingsBoxEl, true); |
}, |
onSelectedDestinationNameSet_: function() { |