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

Unified Diff: chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.cc

Issue 495563003: Move ParallelAuthnticator to chromeos and rename it to CryptohomeAuthenticator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 6 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/auth/chrome_cryptohome_authenticator.cc
diff --git a/chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.cc b/chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ac7694a0adf5a4a63276651c4d3787140a472e45
--- /dev/null
+++ b/chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.cc
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h"
+
+#include "base/thread_task_runner_handle.h"
+#include "chrome/browser/chromeos/ownership/owner_settings_service.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
+#include "components/user_manager/user_manager.h"
+#include "content/public/browser/browser_thread.h"
+
+using content::BrowserThread;
+
+namespace chromeos {
+
+ChromeCryptohomeAuthenticator::ChromeCryptohomeAuthenticator(
+ AuthStatusConsumer* consumer)
+ : CryptohomeAuthenticator(base::ThreadTaskRunnerHandle::Get(), consumer) {
+}
+
+ChromeCryptohomeAuthenticator::~ChromeCryptohomeAuthenticator() {
+}
+
+bool ChromeCryptohomeAuthenticator::IsKnownUser(const UserContext& context) {
+ return user_manager::UserManager::Get()->IsKnownUser(context.GetUserID());
+}
+
+bool ChromeCryptohomeAuthenticator::IsSafeMode() {
+ bool is_safe_mode = false;
+ CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode);
+ return is_safe_mode;
+}
+
+void ChromeCryptohomeAuthenticator::CheckSafeModeOwnership(
+ const UserContext& context,
+ const IsOwnerCallback& callback) {
+ // |IsOwnerForSafeModeAsync| expects logged in state to be
+ // LOGGED_IN_SAFE_MODE.
+ if (LoginState::IsInitialized()) {
+ LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE,
+ LoginState::LOGGED_IN_USER_NONE);
+ }
+
+ OwnerSettingsService::IsOwnerForSafeModeAsync(
+ context.GetUserID(), context.GetUserIDHash(), callback);
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698