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

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

Issue 10918027: Revert 154457 - Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « chrome/browser/chromeos/login/login_performer.h ('k') | chrome/browser/chromeos/login/login_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/login_performer.cc
===================================================================
--- chrome/browser/chromeos/login/login_performer.cc (revision 154482)
+++ chrome/browser/chromeos/login/login_performer.cc (working copy)
@@ -258,10 +258,9 @@
////////////////////////////////////////////////////////////////////////////////
// LoginPerformer, public:
-void LoginPerformer::PerformLogin(const std::string& username,
- const std::string& password,
- AuthorizationMode auth_mode) {
- auth_mode_ = auth_mode;
+void LoginPerformer::CompleteLogin(const std::string& username,
+ const std::string& password) {
+ auth_mode_ = AUTH_MODE_EXTENSION;
username_ = username;
password_ = password;
@@ -272,9 +271,9 @@
if (!ScreenLocker::default_screen_locker()) {
CrosSettingsProvider::TrustedStatus status =
cros_settings->PrepareTrustedValues(
- base::Bind(&LoginPerformer::PerformLogin,
+ base::Bind(&LoginPerformer::CompleteLogin,
weak_factory_.GetWeakPtr(),
- username, password, auth_mode));
+ username, password));
// Must not proceed without signature verification.
if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
if (delegate_)
@@ -292,14 +291,50 @@
bool is_whitelisted = LoginUtils::IsWhitelisted(
gaia::CanonicalizeEmail(username));
if (ScreenLocker::default_screen_locker() || is_whitelisted) {
- switch (auth_mode_) {
- case AUTH_MODE_EXTENSION:
- StartLoginCompletion();
- break;
- case AUTH_MODE_INTERNAL:
- StartAuthentication();
- break;
+ // 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;
}
+ }
+
+ 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);
« no previous file with comments | « chrome/browser/chromeos/login/login_performer.h ('k') | chrome/browser/chromeos/login/login_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698