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

Side by Side Diff: chrome/browser/resources/gaia_auth/main.js

Issue 1179433002: signin: Abort previous 'channelConnected' handling on retry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Authenticator class wraps the communications between Gaia and its host. 6 * Authenticator class wraps the communications between Gaia and its host.
7 */ 7 */
8 function Authenticator() { 8 function Authenticator() {
9 } 9 }
10 10
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 this.supportChannel_.registerMessage( 218 this.supportChannel_.registerMessage(
219 'completeLogin', this.onCompleteLogin_.bind(this)); 219 'completeLogin', this.onCompleteLogin_.bind(this));
220 this.initSAML_(); 220 this.initSAML_();
221 this.supportChannel_.send({name: 'resetAuth'}); 221 this.supportChannel_.send({name: 'resetAuth'});
222 this.maybeInitialized_(); 222 this.maybeInitialized_();
223 }.bind(this)); 223 }.bind(this));
224 224
225 window.setTimeout(function() { 225 window.setTimeout(function() {
226 if (!this.supportChannel_) { 226 if (!this.supportChannel_) {
227 // Give up previous channel and bind its 'channelConnected' to a no-op.
228 supportChannel.registerMessage('channelConnected', function() {});
229
227 // Re-initialize the channel if it is not connected properly, e.g. 230 // Re-initialize the channel if it is not connected properly, e.g.
228 // connect may be called before background script started running. 231 // connect may be called before background script started running.
229 this.initSupportChannel_(); 232 this.initSupportChannel_();
230 } 233 }
231 }.bind(this), 200); 234 }.bind(this), 200);
232 }, 235 },
233 236
234 /** 237 /**
235 * Called when one of the initialization stages has finished. If all the 238 * Called when one of the initialization stages has finished. If all the
236 * needed parts are initialized, notifies parent about successfull 239 * needed parts are initialized, notifies parent about successfull
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } else if (msg.method == 'redirectToSignin' && 544 } else if (msg.method == 'redirectToSignin' &&
542 this.isParentMessage_(e)) { 545 this.isParentMessage_(e)) {
543 $('gaia-frame').src = this.constructInitialFrameUrl_(); 546 $('gaia-frame').src = this.constructInitialFrameUrl_();
544 } else { 547 } else {
545 console.error('Authenticator.onMessage: unknown message + origin!?'); 548 console.error('Authenticator.onMessage: unknown message + origin!?');
546 } 549 }
547 } 550 }
548 }; 551 };
549 552
550 Authenticator.getInstance().initialize(); 553 Authenticator.getInstance().initialize();
OLDNEW
« no previous file with comments | « chrome/browser/resources/gaia_auth/channel.js ('k') | chrome/browser/resources/gaia_auth_host/post_message_channel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698