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(
}
Profile* profile = ProfileManager::GetDefaultProfile();
if (profile) {
ProfileSyncService* service(
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile));
if (service && !service->HasSyncSetupCompleted()) {
SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
DCHECK(signin);
GoogleServiceSigninSuccessDetails details(
signin->GetAuthenticatedUsername(),
password);
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
content::Source<Profile>(profile),
content::Details<const GoogleServiceSigninSuccessDetails>(&details));
}
if (profile && !password.empty()) {
// We have a non-empty password, so notify listeners (such as the sync
// engine).
SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
DCHECK(signin);
GoogleServiceSigninSuccessDetails details(
signin->GetAuthenticatedUsername(),
password);
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
content::Source<Profile>(profile),
content::Details<const GoogleServiceSigninSuccessDetails>(&details));
}
DBusThreadManager::Get()->GetPowerManagerClient()->
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