diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-22 23:12:15 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-22 23:12:15 +0000 |
commit | de5ab1f6b7cb818edd2188db7188b5dfc03d4415 (patch) | |
tree | 34c3d71ad078462b427e7f2c5187c9d20ead8961 | |
parent | 4a56d244f001527dbfcd3d8702c285bfd2798b97 (diff) | |
download | chromium_src-de5ab1f6b7cb818edd2188db7188b5dfc03d4415.zip chromium_src-de5ab1f6b7cb818edd2188db7188b5dfc03d4415.tar.gz chromium_src-de5ab1f6b7cb818edd2188db7188b5dfc03d4415.tar.bz2 |
chromeos: Forces gaia reload when hiding error message.
- Forces gaia reload when hiding error message;
- More logging in GaiaSigninScreen.onMessage_;
- Also fix a racing condition that OnUserImageChanged is called before login
ui is loaded.
BUG=chromium-os:26363
TEST=Verify fix for chromium-os:26363.
Review URL: http://codereview.chromium.org/9423017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123129 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 16 insertions, 5 deletions
diff --git a/chrome/browser/resources/chromeos/login/screen_error_message.js b/chrome/browser/resources/chromeos/login/screen_error_message.js index d2015d5..597cb4e 100644 --- a/chrome/browser/resources/chromeos/login/screen_error_message.js +++ b/chrome/browser/resources/chromeos/login/screen_error_message.js @@ -212,8 +212,8 @@ cr.define('login', function() { currentScreen.classList.remove('hidden'); currentScreen.classList.remove('faded'); - // Ensures 'loading' state really means loading for Gaia screen. - if (currentScreen.id == 'gaia-signin' && currentScreen.loading) + // Forces a reload for Gaia screen on hiding error message. + if (currentScreen.id == 'gaia-signin') currentScreen.doReload(); } } diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js index a0137f3..c059ff0 100644 --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js +++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js @@ -247,13 +247,21 @@ cr.define('login', function() { * @param e {object} Payload of the received HTML5 message. */ onMessage_: function(e) { + if (!this.isAuthExtMessage_(e)) { + console.log('GaiaSigninScreen.onMessage_: Unknown message origin, ' + + 'e.origin=' + e.origin); + return; + } + var msg = e.data; - if (msg.method == 'completeLogin' && this.isAuthExtMessage_(e)) { + console.log('GaiaSigninScreen.onMessage_: method=' + msg.method); + + if (msg.method == 'completeLogin') { chrome.send('completeLogin', [msg.email, msg.password] ); this.loading = true; // Now that we're in logged in state header should be hidden. Oobe.getInstance().headerHidden = true; - } else if (msg.method == 'loginUILoaded' && this.isAuthExtMessage_(e)) { + } else if (msg.method == 'loginUILoaded') { this.loading = false; $('error-message').update(); this.clearLoadingTimer_(); @@ -264,7 +272,7 @@ cr.define('login', function() { } this.clearRetry_(); chrome.send('loginWebuiReady'); - } else if (msg.method =='offlineLogin' && this.isAuthExtMessage_(e)) { + } else if (msg.method =='offlineLogin') { this.email = msg.email; chrome.send('authenticateUser', [msg.email, msg.password]); this.loading = true; diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index f44b02c..a596e13 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc @@ -457,6 +457,9 @@ void SigninScreenHandler::OnUserRemoved(const std::string& username) { } void SigninScreenHandler::OnUserImageChanged(const User& user) { + if (!page_is_ready()) + return; + base::StringValue user_email(user.email()); web_ui()->CallJavascriptFunction( "login.AccountPickerScreen.updateUserImage", user_email); |