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

Unified Diff: chrome/browser/resources/print_preview/settings/destination_settings.js

Issue 150943006: Show destination offline status in the print preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 6 years, 10 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
« no previous file with comments | « chrome/browser/resources/print_preview/settings/destination_settings.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « chrome/browser/resources/print_preview/settings/destination_settings.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698