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

Unified Diff: web/inc/auth/auth-signin.html

Issue 2335223003: LogDog: Update web code, stream/query with auth. (Closed)
Patch Set: Fix background page loading. 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
« no previous file with comments | « web/bower.json ('k') | web/inc/logdog-stream-view/logdog-stream-fetcher.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: web/inc/auth/auth-signin.html
diff --git a/web/inc/auth/auth-signin.html b/web/inc/auth/auth-signin.html
index 0657c47212460260241f25441db9b97bbb9d2277..87b3ea4213d6daf0308bbec3593e83e8407a6aa4 100644
--- a/web/inc/auth/auth-signin.html
+++ b/web/inc/auth/auth-signin.html
@@ -24,7 +24,6 @@
</style>
<google-signin-aware id="aware"
- client-id="[[clientId]]"
scopes="email"
on-google-signin-aware-success="_onSignin"
on-google-signin-aware-signed-out="_onSignout"
@@ -59,6 +58,40 @@
profile: {
type: Object,
readOnly: true
+ },
+
+ clientId: {
+ type: String,
+ notify: true,
+ observer: '_clientIdChanged',
+ },
+ },
+
+ created: function() {
+ this._attached = false;
+ this._lastPushedClientId = null;
+ },
+
+ attached: function() {
+ this._attached = true;
+ this._pushClientId();
+ },
+
+ _clientIdChanged: function() {
+ this._pushClientId();
+ },
+
+ _pushClientId: function() {
+ // Set the client ID here explicitly rather than data-binding. If this
+ // page is loaded in the background, the "auth-signin-aware" AuthEngine
+ // will sign in before the <augh-signin-aware> elements actually attach.
+ // Consequently, they will never receive the sign-in success/fail event.
+ //
+ // By delaying the Client ID setting until the elements have all been
+ // attached, we ensure that they all receive the event as intended.
+ if (this._attached && (this.clientId != this._lastPushedClientId)) {
+ this.$.aware.clientId = this.clientId;
+ this._lastPushedClientId = this.clientId;
}
},
« no previous file with comments | « web/bower.json ('k') | web/inc/logdog-stream-view/logdog-stream-fetcher.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698