OLD | NEW |
---|---|
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 #include "chrome/browser/chromeos/login/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/screen_locker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 if (authentication_start_time_.is_null()) { | 179 if (authentication_start_time_.is_null()) { |
180 if (!username.empty()) | 180 if (!username.empty()) |
181 LOG(WARNING) << "authentication_start_time_ is not set"; | 181 LOG(WARNING) << "authentication_start_time_ is not set"; |
182 } else { | 182 } else { |
183 base::TimeDelta delta = base::Time::Now() - authentication_start_time_; | 183 base::TimeDelta delta = base::Time::Now() - authentication_start_time_; |
184 VLOG(1) << "Authentication success time: " << delta.InSecondsF(); | 184 VLOG(1) << "Authentication success time: " << delta.InSecondsF(); |
185 UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta); | 185 UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta); |
186 } | 186 } |
187 | 187 |
188 Profile* profile = ProfileManager::GetDefaultProfile(); | 188 Profile* profile = ProfileManager::GetDefaultProfile(); |
189 if (profile) { | 189 if (profile && !password.empty()) { |
Nikita (slow)
2012/06/07 09:43:59
How could you end up in this state with empty pass
Andrew T Wilson (Slow)
2012/06/07 17:22:42
Here is what Bartosz reported to me:
-=-=-=-
Barto
| |
190 ProfileSyncService* service( | 190 // If we have a non-empty password, notify listeners (such as the sync |
191 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile)); | 191 // engine). |
192 if (service && !service->HasSyncSetupCompleted()) { | 192 if (!password.empty()) { |
Nikita (slow)
2012/06/07 09:43:59
Why do you need another check for empty password a
Andrew T Wilson (Slow)
2012/06/07 17:22:42
Bah, I moved the check up above but forgot to remo
| |
193 SigninManager* signin = SigninManagerFactory::GetForProfile(profile); | 193 SigninManager* signin = SigninManagerFactory::GetForProfile(profile); |
194 DCHECK(signin); | 194 DCHECK(signin); |
195 GoogleServiceSigninSuccessDetails details( | 195 GoogleServiceSigninSuccessDetails details( |
196 signin->GetAuthenticatedUsername(), | 196 signin->GetAuthenticatedUsername(), |
197 password); | 197 password); |
198 content::NotificationService::current()->Notify( | 198 content::NotificationService::current()->Notify( |
199 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, | 199 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, |
200 content::Source<Profile>(profile), | 200 content::Source<Profile>(profile), |
201 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); | 201 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); |
202 } | 202 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 bool state = true; | 366 bool state = true; |
367 content::NotificationService::current()->Notify( | 367 content::NotificationService::current()->Notify( |
368 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 368 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
369 content::Source<ScreenLocker>(this), | 369 content::Source<ScreenLocker>(this), |
370 content::Details<bool>(&state)); | 370 content::Details<bool>(&state)); |
371 DBusThreadManager::Get()->GetPowerManagerClient()-> | 371 DBusThreadManager::Get()->GetPowerManagerClient()-> |
372 NotifyScreenLockCompleted(); | 372 NotifyScreenLockCompleted(); |
373 } | 373 } |
374 | 374 |
375 } // namespace chromeos | 375 } // namespace chromeos |
OLD | NEW |