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

Unified Diff: chrome/browser/chromeos/login/screen_locker.cc

Issue 4980005: Allow sync with 2-factor StrongAuth accounts in ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored 2-factor error passing Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/screen_locker.cc
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index 2d8ccd08ea5d0ed9f4e6899a2e923814298f6266..6b81138209bbc6cb8f0a0bac3b2a5bd441211435 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -33,6 +33,8 @@
#include "chrome/browser/chromeos/system_key_event_listener.h"
#include "chrome/browser/chromeos/wm_ipc.h"
#include "chrome/browser/metrics/user_metrics.h"
+#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
@@ -700,6 +702,15 @@ void ScreenLocker::OnLoginSuccess(
UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta);
}
+ Profile* profile = ProfileManager::GetDefaultProfile();
+ if (profile) {
+ ProfileSyncService* service = profile->GetProfileSyncService(username);
+ if (service && !service->HasSyncSetupCompleted()) {
+ // If sync has failed somehow, try setting the sync passphrase here.
+ service->SetPassphrase(password, false);
+ }
+ }
+
if (CrosLibrary::Get()->EnsureLoaded())
CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenUnlockRequested();
}

Powered by Google App Engine
This is Rietveld 408576698