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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2361513003: MD History: Update sign in state in data source (Closed)
Patch Set: try another approach Created 4 years, 3 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
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 33e2c62d79a61eec7d0d97c1c32fad400fe67ff8..850249d40ed8ab96975e93a83a71e088d86edd57 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -22,7 +22,10 @@ cr.define('md_history', function() {
Polymer({
is: 'history-app',
- behaviors: [Polymer.IronScrollTargetBehavior],
+ behaviors: [
+ Polymer.IronScrollTargetBehavior,
+ WebUIListenerBehavior,
+ ],
properties: {
// Used to display notices for profile sign-in status.
@@ -74,8 +77,7 @@ Polymer({
isUserSignedIn_: {
type: Boolean,
- // Updated on synced-device-manager attach by chrome.sending
- // 'otherDevicesInitialized'.
+ // Updated on synced-device-manager.
value: loadTimeData.getBoolean('isUserSignedIn'),
},
@@ -105,6 +107,12 @@ Polymer({
document.addEventListener('command', this.onCommand_.bind(this));
},
+ /** @override */
+ attached: function() {
+ this.addWebUIListener('sign-in-state-updated',
+ this.updateSignInState.bind(this));
Dan Beam 2016/09/28 03:56:49 this part is perfect :)
+ },
+
onFirstRender: function() {
setTimeout(function() {
chrome.send(

Powered by Google App Engine
This is Rietveld 408576698