Index: chrome/browser/resources/print_preview/search/destination_search.js |
diff --git a/chrome/browser/resources/print_preview/search/destination_search.js b/chrome/browser/resources/print_preview/search/destination_search.js |
index 71f02017b8a7633bc0d70a4f28eebc4b24f117dd..486929ee6fa8c8168b0c26e360134cf11f97bc8f 100644 |
--- a/chrome/browser/resources/print_preview/search/destination_search.js |
+++ b/chrome/browser/resources/print_preview/search/destination_search.js |
@@ -147,6 +147,7 @@ cr.define('print_preview', function() { |
print_preview.Metrics.DestinationSearchBucket. |
CLOUDPRINT_PROMO_SHOWN); |
} |
+ this.onUsersChanged_(); |
this.reflowLists_(); |
} else { |
this.getElement().classList.add('transparent'); |
@@ -224,7 +225,7 @@ cr.define('print_preview', function() { |
this.tracker.add( |
this.destinationStore_, |
print_preview.DestinationStore.EventType.DESTINATION_SEARCH_DONE, |
- this.updateThrobbers_.bind(this)); |
+ this.onDestinationSearchDone_.bind(this)); |
this.tracker.add( |
this.localList_, |
@@ -312,7 +313,9 @@ cr.define('print_preview', function() { |
var cloudDestinations = []; |
var unregisteredCloudDestinations = []; |
- this.destinationStore_.destinations.forEach(function(destination) { |
+ var destinations = |
+ this.destinationStore_.destinations(this.userInfo_.activeUser); |
+ destinations.forEach(function(destination) { |
if (destination.isRecent) { |
recentDestinations.push(destination); |
} |
@@ -480,7 +483,8 @@ cr.define('print_preview', function() { |
* @private |
*/ |
onDestinationStoreSelect_: function() { |
- var destinations = this.destinationStore_.destinations; |
+ var destinations = |
+ this.destinationStore_.destinations(this.userInfo_.activeUser); |
var recentDestinations = []; |
destinations.forEach(function(destination) { |
if (destination.isRecent) { |
@@ -502,6 +506,17 @@ cr.define('print_preview', function() { |
}, |
/** |
+ * Called when destinations are inserted into the store. Rerenders |
+ * destinations. |
+ * @private |
+ */ |
+ onDestinationSearchDone_: function() { |
+ this.updateThrobbers_(); |
+ this.renderDestinations_(); |
+ this.reflowLists_(); |
+ }, |
+ |
+ /** |
* Called when the manage cloud printers action is activated. |
* @private |
*/ |
@@ -543,6 +558,7 @@ cr.define('print_preview', function() { |
accountSelectEl.options[accountSelectEl.selectedIndex].value; |
if (account) { |
this.userInfo_.activeUser = account; |
+ this.destinationStore_.reloadUserCookieBasedDestinations(); |
} else { |
cr.dispatchSimpleEvent(this, DestinationSearch.EventType.ADD_ACCOUNT); |
// Set selection back to the active user. |