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

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

Issue 10832035: Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 4 months 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/login_performer.cc
diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc
index 7a364d7074a0bec2a3e1d9338f91b77d4d21ee24..169d6d4f4248ce687e75f9c14b007ae4f3a4368f 100644
--- a/chrome/browser/chromeos/login/login_performer.cc
+++ b/chrome/browser/chromeos/login/login_performer.cc
@@ -258,9 +258,10 @@ void LoginPerformer::Observe(int type,
////////////////////////////////////////////////////////////////////////////////
// LoginPerformer, public:
-void LoginPerformer::CompleteLogin(const std::string& username,
- const std::string& password) {
- auth_mode_ = AUTH_MODE_EXTENSION;
+void LoginPerformer::PerformLogin(const std::string& username,
+ const std::string& password,
+ AuthorizationMode auth_mode) {
+ auth_mode_ = auth_mode;
username_ = username;
password_ = password;
@@ -271,9 +272,9 @@ void LoginPerformer::CompleteLogin(const std::string& username,
if (!ScreenLocker::default_screen_locker()) {
CrosSettingsProvider::TrustedStatus status =
cros_settings->PrepareTrustedValues(
- base::Bind(&LoginPerformer::CompleteLogin,
+ base::Bind(&LoginPerformer::PerformLogin,
weak_factory_.GetWeakPtr(),
- username, password));
+ username, password, auth_mode));
// Must not proceed without signature verification.
if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
if (delegate_)
@@ -291,50 +292,14 @@ void LoginPerformer::CompleteLogin(const std::string& username,
bool is_whitelisted = LoginUtils::IsWhitelisted(
gaia::CanonicalizeEmail(username));
if (ScreenLocker::default_screen_locker() || is_whitelisted) {
- // Starts authentication if guest login is allowed or online auth pending.
- StartLoginCompletion();
- } else {
- if (delegate_)
- delegate_->WhiteListCheckFailed(username);
- else
- NOTREACHED();
- }
-}
-
-void LoginPerformer::Login(const std::string& username,
- const std::string& password) {
- auth_mode_ = AUTH_MODE_INTERNAL;
- username_ = username;
- password_ = password;
-
- CrosSettings* cros_settings = CrosSettings::Get();
-
- // Whitelist check is always performed during initial login and
- // should not be performed when ScreenLock is active (pending online auth).
- if (!ScreenLocker::default_screen_locker()) {
- CrosSettingsProvider::TrustedStatus status =
- cros_settings->PrepareTrustedValues(
- base::Bind(&LoginPerformer::Login,
- weak_factory_.GetWeakPtr(),
- username, password));
- // Must not proceed without signature verification.
- if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
- if (delegate_)
- delegate_->PolicyLoadFailed();
- else
- NOTREACHED();
- return;
- } else if (status != CrosSettingsProvider::TRUSTED) {
- // Value of AllowNewUser setting is still not verified.
- // Another attempt will be invoked after verification completion.
- return;
+ switch (auth_mode_) {
+ case AUTH_MODE_EXTENSION:
+ StartLoginCompletion();
+ break;
+ case AUTH_MODE_INTERNAL:
+ StartAuthentication();
+ break;
}
- }
-
- bool is_whitelisted = LoginUtils::IsWhitelisted(username);
- if (ScreenLocker::default_screen_locker() || is_whitelisted) {
- // Starts authentication if guest login is allowed or online auth pending.
- StartAuthentication();
} else {
if (delegate_)
delegate_->WhiteListCheckFailed(username);

Powered by Google App Engine
This is Rietveld 408576698