Commit 0bd6bb28 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Cryptohome cleanup: remove unnecessary AuthAttemptResolver interface

Bug: 1150430
Change-Id: I7227d9d8f0918765f8e18c0bf7dc95294405065b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2552916
Auto-Submit: Denis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830196}
parent 40ce9570
...@@ -38,8 +38,6 @@ component("auth") { ...@@ -38,8 +38,6 @@ component("auth") {
sources = [ sources = [
"auth_attempt_state.cc", "auth_attempt_state.cc",
"auth_attempt_state.h", "auth_attempt_state.h",
"auth_attempt_state_resolver.cc",
"auth_attempt_state_resolver.h",
"auth_status_consumer.cc", "auth_status_consumer.cc",
"auth_status_consumer.h", "auth_status_consumer.h",
"authenticator.cc", "authenticator.cc",
...@@ -97,8 +95,6 @@ source_set("test_support") { ...@@ -97,8 +95,6 @@ source_set("test_support") {
sources = [ sources = [
"fake_extended_authenticator.cc", "fake_extended_authenticator.cc",
"fake_extended_authenticator.h", "fake_extended_authenticator.h",
"mock_auth_attempt_state_resolver.cc",
"mock_auth_attempt_state_resolver.h",
"mock_auth_status_consumer.cc", "mock_auth_status_consumer.cc",
"mock_auth_status_consumer.h", "mock_auth_status_consumer.h",
] ]
......
// 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 "chromeos/login/auth/auth_attempt_state_resolver.h"
namespace chromeos {
AuthAttemptStateResolver::AuthAttemptStateResolver() = default;
AuthAttemptStateResolver::~AuthAttemptStateResolver() = default;
} // namespace chromeos
// 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.
#ifndef CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_RESOLVER_H_
#define CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_RESOLVER_H_
#include "base/component_export.h"
namespace chromeos {
class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) AuthAttemptStateResolver {
public:
AuthAttemptStateResolver();
virtual ~AuthAttemptStateResolver();
// Gather existing status info and attempt to resolve it into one of a
// set of discrete states.
virtual void Resolve() = 0;
};
} // namespace chromeos
#endif // CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_RESOLVER_H_
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "chromeos/login/auth/auth_attempt_state.h" #include "chromeos/login/auth/auth_attempt_state.h"
#include "chromeos/login/auth/auth_attempt_state_resolver.h"
#include "chromeos/login/auth/authenticator.h" #include "chromeos/login/auth/authenticator.h"
#include "chromeos/login/auth/test_attempt_state.h" #include "chromeos/login/auth/test_attempt_state.h"
#include "google_apis/gaia/gaia_auth_consumer.h" #include "google_apis/gaia/gaia_auth_consumer.h"
...@@ -61,8 +60,7 @@ class AuthStatusConsumer; ...@@ -61,8 +60,7 @@ class AuthStatusConsumer;
// Old password ok: RECOVER_MOUNT > CONTINUE > ONLINE_LOGIN // Old password ok: RECOVER_MOUNT > CONTINUE > ONLINE_LOGIN
// //
class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) CryptohomeAuthenticator class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) CryptohomeAuthenticator
: public Authenticator, : public Authenticator {
public AuthAttemptStateResolver {
public: public:
enum AuthState { enum AuthState {
CONTINUE = 0, // State indeterminate; try again with more info. CONTINUE = 0, // State indeterminate; try again with more info.
...@@ -167,14 +165,13 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) CryptohomeAuthenticator ...@@ -167,14 +165,13 @@ class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) CryptohomeAuthenticator
// Called after UnmountEx finishes. // Called after UnmountEx finishes.
void OnUnmountEx(base::Optional<cryptohome::BaseReply> reply); void OnUnmountEx(base::Optional<cryptohome::BaseReply> reply);
// AuthAttemptStateResolver overrides.
// Attempts to make a decision and call back |consumer_| based on // Attempts to make a decision and call back |consumer_| based on
// the state we have gathered at the time of call. If a decision // the state we have gathered at the time of call. If a decision
// can't be made, defers until the next time this is called. // can't be made, defers until the next time this is called.
// When a decision is made, will call back to |consumer_| on the UI thread. // When a decision is made, will call back to |consumer_| on the UI thread.
// //
// Must be called on the UI thread. // Must be called on the UI thread.
void Resolve() override; void Resolve();
void OnOffTheRecordAuthSuccess(); void OnOffTheRecordAuthSuccess();
void OnPasswordChangeDetected(); void OnPasswordChangeDetected();
......
// 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 "chromeos/login/auth/mock_auth_attempt_state_resolver.h"
namespace chromeos {
MockAuthAttemptStateResolver::MockAuthAttemptStateResolver() = default;
MockAuthAttemptStateResolver::~MockAuthAttemptStateResolver() = default;
} // namespace chromeos
// 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.
#ifndef CHROMEOS_LOGIN_AUTH_MOCK_AUTH_ATTEMPT_STATE_RESOLVER_H_
#define CHROMEOS_LOGIN_AUTH_MOCK_AUTH_ATTEMPT_STATE_RESOLVER_H_
#include "base/component_export.h"
#include "base/macros.h"
#include "chromeos/login/auth/auth_attempt_state_resolver.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace chromeos {
class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) MockAuthAttemptStateResolver
: public AuthAttemptStateResolver {
public:
MockAuthAttemptStateResolver();
virtual ~MockAuthAttemptStateResolver();
MOCK_METHOD0(Resolve, void(void));
private:
DISALLOW_COPY_AND_ASSIGN(MockAuthAttemptStateResolver);
};
} // namespace chromeos
#endif // CHROMEOS_LOGIN_AUTH_MOCK_AUTH_ATTEMPT_STATE_RESOLVER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment