Chromium Code Reviews| Index: chrome/browser/resources/md_history/synced_device_manager.js |
| diff --git a/chrome/browser/resources/md_history/synced_device_manager.js b/chrome/browser/resources/md_history/synced_device_manager.js |
| index 12e67fddbe540238b32f22538bf1542ee2947b2d..2e3759bf780d3ca6b6820f0d2d55ce0ec5977db3 100644 |
| --- a/chrome/browser/resources/md_history/synced_device_manager.js |
| +++ b/chrome/browser/resources/md_history/synced_device_manager.js |
| @@ -39,9 +39,11 @@ Polymer({ |
| }, |
| /** @private */ |
| - signInState_: { |
| + signInState: { |
| type: Boolean, |
| + // Updated on attach by chrome.sending 'otherDevicesInitialized'. |
| value: loadTimeData.getBoolean('isUserSignedIn'), |
| + observer: 'signInStateChanged_', |
| }, |
| /** @private */ |
| @@ -227,18 +229,13 @@ Polymer({ |
| * Get called when user's sign in state changes, this will affect UI of synced |
| * tabs page. Sign in promo gets displayed when user is signed out, and |
| * different messages are shown when there are no synced tabs. |
| - * @param {boolean} isUserSignedIn |
| + * @param {boolean} signInState |
| */ |
| - updateSignInState: function(isUserSignedIn) { |
| - // If user's sign in state didn't change, then don't change message or |
| - // update UI. |
| - if (this.signInState_ == isUserSignedIn) |
| - return; |
| - |
| - this.signInState_ = isUserSignedIn; |
| + signInStateChanged_: function(signInState) { |
|
tsergeant
2016/08/17 06:03:09
Convention is for observer functions to leave out
calamity
2016/08/18 03:11:15
Done.
|
| + this.fire('history-view-changed'); |
| // User signed out, clear synced device list and show the sign in promo. |
| - if (!isUserSignedIn) { |
| + if (!signInState) { |
| this.clearDisplayedSyncedDevices_(); |
| return; |
| } |