Commit 308ddc14 authored by atwilson@chromium.org's avatar atwilson@chromium.org

Fix ScreenLocker to not send notifications with empty passwords.

bartfab ran into this as a result of an unrelated patch he was testing. The logic in ScreenLocker should match that in LoginUtils, and not send this notification out if the password is blank.

BUG=chromium-os:31600
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10544043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141252 0039d316-1c4b-4281-b951-d872f2087c98
parent f1023cdb
...@@ -186,20 +186,18 @@ void ScreenLocker::OnLoginSuccess( ...@@ -186,20 +186,18 @@ void ScreenLocker::OnLoginSuccess(
} }
Profile* profile = ProfileManager::GetDefaultProfile(); Profile* profile = ProfileManager::GetDefaultProfile();
if (profile) { if (profile && !password.empty()) {
ProfileSyncService* service( // We have a non-empty password, so notify listeners (such as the sync
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile)); // engine).
if (service && !service->HasSyncSetupCompleted()) { SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
SigninManager* signin = SigninManagerFactory::GetForProfile(profile); DCHECK(signin);
DCHECK(signin); GoogleServiceSigninSuccessDetails details(
GoogleServiceSigninSuccessDetails details( signin->GetAuthenticatedUsername(),
signin->GetAuthenticatedUsername(), password);
password); content::NotificationService::current()->Notify(
content::NotificationService::current()->Notify( chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, content::Source<Profile>(profile),
content::Source<Profile>(profile), content::Details<const GoogleServiceSigninSuccessDetails>(&details));
content::Details<const GoogleServiceSigninSuccessDetails>(&details));
}
} }
DBusThreadManager::Get()->GetPowerManagerClient()-> DBusThreadManager::Get()->GetPowerManagerClient()->
NotifyScreenUnlockRequested(); NotifyScreenUnlockRequested();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment