Commit 18effeae authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

EasyUnlockService and friends: Remove unused methods.

R=khorimoto@chromium.org, stevenjb@chromium.org

Bug: none
Test: none
Change-Id: I0417430122f57980e62b52a40d44f9c1e38024d6
Reviewed-on: https://chromium-review.googlesource.com/1003895Reviewed-by: default avatarToni Barzic <tbarzic@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarDave Schuyler <dschuyler@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550301}
parent d780e1bf
......@@ -378,14 +378,6 @@ bool EasyUnlockService::UpdateScreenlockState(ScreenlockState state) {
return true;
}
ScreenlockState EasyUnlockService::GetScreenlockState() {
EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler();
if (!handler)
return ScreenlockState::INACTIVE;
return handler->state();
}
void EasyUnlockService::AttemptAuth(const AccountId& account_id) {
const EasyUnlockAuthAttempt::Type auth_attempt_type =
GetType() == TYPE_REGULAR ? EasyUnlockAuthAttempt::TYPE_UNLOCK
......@@ -526,12 +518,6 @@ void EasyUnlockService::Shutdown() {
weak_ptr_factory_.InvalidateWeakPtrs();
}
void EasyUnlockService::ReloadAppAndLockScreen() {
// Make sure lock screen state set by the extension gets reset.
ResetScreenlockState();
app_manager_->ReloadApp();
}
void EasyUnlockService::UpdateAppState() {
if (IsAllowed()) {
EnsureTpmKeyPresentIfNeeded();
......
......@@ -26,7 +26,6 @@
class AccountId;
namespace base {
class DictionaryValue;
class ListValue;
} // namespace base
......@@ -93,8 +92,6 @@ class EasyUnlockService : public KeyedService {
virtual void LaunchSetup() = 0;
// Gets/Sets/Clears the permit access for the local device.
virtual const base::DictionaryValue* GetPermitAccess() const = 0;
virtual void SetPermitAccess(const base::DictionaryValue& permit) = 0;
virtual void ClearPermitAccess() = 0;
// Gets/Sets the remote devices list.
......@@ -159,10 +156,6 @@ class EasyUnlockService : public KeyedService {
// the service to reflect the provided screenlock state.
bool UpdateScreenlockState(proximity_auth::ScreenlockState state);
// Returns the screenlock state if it is available. Otherwise STATE_INACTIVE
// is returned.
proximity_auth::ScreenlockState GetScreenlockState();
// Starts an auth attempt for the user associated with the service. The
// attempt type (unlock vs. signin) will depend on the service type.
void AttemptAuth(const AccountId& account_id);
......@@ -238,10 +231,6 @@ class EasyUnlockService : public KeyedService {
// Opens an Easy Unlock Setup app window.
void OpenSetupApp();
// Reloads the Easy unlock component app if it's loaded and resets the lock
// screen state.
void ReloadAppAndLockScreen();
// Checks whether Easy unlock should be running and updates app state.
void UpdateAppState();
......
......@@ -299,24 +299,6 @@ void EasyUnlockServiceRegular::SetHardlockAfterKeyOperation(
CheckCryptohomeKeysAndMaybeHardlock();
}
const base::DictionaryValue* EasyUnlockServiceRegular::GetPermitAccess() const {
const base::DictionaryValue* pairing_dict =
profile()->GetPrefs()->GetDictionary(prefs::kEasyUnlockPairing);
const base::DictionaryValue* permit_dict = NULL;
if (pairing_dict &&
pairing_dict->GetDictionary(kKeyPermitAccess, &permit_dict))
return permit_dict;
return NULL;
}
void EasyUnlockServiceRegular::SetPermitAccess(
const base::DictionaryValue& permit) {
DictionaryPrefUpdate pairing_update(profile()->GetPrefs(),
prefs::kEasyUnlockPairing);
pairing_update->SetKey(kKeyPermitAccess, permit.Clone());
}
void EasyUnlockServiceRegular::ClearPermitAccess() {
DictionaryPrefUpdate pairing_update(profile()->GetPrefs(),
prefs::kEasyUnlockPairing);
......
......@@ -20,7 +20,6 @@
#include "components/prefs/pref_change_registrar.h"
namespace base {
class DictionaryValue;
class ListValue;
} // namespace base
......@@ -82,8 +81,6 @@ class EasyUnlockServiceRegular
EasyUnlockService::Type GetType() const override;
AccountId GetAccountId() const override;
void LaunchSetup() override;
const base::DictionaryValue* GetPermitAccess() const override;
void SetPermitAccess(const base::DictionaryValue& permit) override;
void ClearPermitAccess() override;
const base::ListValue* GetRemoteDevices() const override;
void SetRemoteDevices(const base::ListValue& devices) override;
......@@ -139,10 +136,6 @@ class EasyUnlockServiceRegular
std::unique_ptr<ShortLivedUserContext> short_lived_user_context_;
// Updates local state with the preference from the user's profile, so they
// can be accessed on the sign-in screen.
void SyncProfilePrefsToLocalState();
// Returns the CryptAuthEnrollmentManager, which manages the profile's
// CryptAuth enrollment.
cryptauth::CryptAuthEnrollmentManager* GetCryptAuthEnrollmentManager();
......
......@@ -169,10 +169,6 @@ EasyUnlockServiceSignin::EasyUnlockServiceSignin(Profile* profile)
EasyUnlockServiceSignin::~EasyUnlockServiceSignin() {}
void EasyUnlockServiceSignin::SetCurrentUser(const AccountId& account_id) {
OnFocusedUserChanged(account_id);
}
void EasyUnlockServiceSignin::WrapChallengeForUserAndDevice(
const AccountId& account_id,
const std::string& device_public_key,
......@@ -223,15 +219,6 @@ void EasyUnlockServiceSignin::LaunchSetup() {
NOTREACHED();
}
const base::DictionaryValue* EasyUnlockServiceSignin::GetPermitAccess() const {
return nullptr;
}
void EasyUnlockServiceSignin::SetPermitAccess(
const base::DictionaryValue& permit) {
NOTREACHED();
}
void EasyUnlockServiceSignin::ClearPermitAccess() {
NOTREACHED();
}
......
......@@ -35,10 +35,6 @@ class EasyUnlockServiceSignin
explicit EasyUnlockServiceSignin(Profile* profile);
~EasyUnlockServiceSignin() override;
// Sets |account_id| as the current user of the service. Note this does
// not change the focused user on the login screen.
void SetCurrentUser(const AccountId& account_id);
// Wraps the challenge for the remote device identified by |account_id| and
// the
// |device_public_key|. The |channel_binding_data| is signed by the TPM
......@@ -87,8 +83,6 @@ class EasyUnlockServiceSignin
EasyUnlockService::Type GetType() const override;
AccountId GetAccountId() const override;
void LaunchSetup() override;
const base::DictionaryValue* GetPermitAccess() const override;
void SetPermitAccess(const base::DictionaryValue& permit) override;
void ClearPermitAccess() override;
const base::ListValue* GetRemoteDevices() const override;
void SetRemoteDevices(const base::ListValue& devices) override;
......
......@@ -447,26 +447,6 @@ void EasyUnlockPrivateUnwrapSecureMessageFunction::OnData(
Respond(NoArguments());
}
EasyUnlockPrivateSetPermitAccessFunction::
EasyUnlockPrivateSetPermitAccessFunction() {
}
EasyUnlockPrivateSetPermitAccessFunction::
~EasyUnlockPrivateSetPermitAccessFunction() {
}
ExtensionFunction::ResponseAction
EasyUnlockPrivateSetPermitAccessFunction::Run() {
std::unique_ptr<easy_unlock_private::SetPermitAccess::Params> params(
easy_unlock_private::SetPermitAccess::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
Profile* profile = Profile::FromBrowserContext(browser_context());
chromeos::EasyUnlockService::Get(profile)->SetPermitAccess(
*params->permit_access.ToValue());
return RespondNow(NoArguments());
}
EasyUnlockPrivateGetPermitAccessFunction::
EasyUnlockPrivateGetPermitAccessFunction() {
}
......
......@@ -170,22 +170,6 @@ class EasyUnlockPrivateUnwrapSecureMessageFunction
DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateUnwrapSecureMessageFunction);
};
class EasyUnlockPrivateSetPermitAccessFunction
: public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("easyUnlockPrivate.setPermitAccess",
EASYUNLOCKPRIVATE_SETPERMITACCESS)
EasyUnlockPrivateSetPermitAccessFunction();
private:
~EasyUnlockPrivateSetPermitAccessFunction() override;
// ExtensionFunction:
ResponseAction Run() override;
DISALLOW_COPY_AND_ASSIGN(EasyUnlockPrivateSetPermitAccessFunction);
};
class EasyUnlockPrivateGetPermitAccessFunction
: public UIThreadExtensionFunction {
public:
......
......@@ -56,10 +56,6 @@ class FakeEasyUnlockService : public EasyUnlockService {
Type GetType() const override { return TYPE_REGULAR; }
AccountId GetAccountId() const override { return EmptyAccountId(); }
void LaunchSetup() override {}
const base::DictionaryValue* GetPermitAccess() const override {
return nullptr;
}
void SetPermitAccess(const base::DictionaryValue& permit) override {}
void ClearPermitAccess() override {}
const base::ListValue* GetRemoteDevices() const override { return nullptr; }
......
......@@ -237,12 +237,6 @@ namespace easyUnlockPrivate {
UnwrapSecureMessageOptions options,
DataCallback callback);
// Saves the permit record for the local device.
// |permitAccess|: The permit record to be saved.
// |callback|: Called to indicate success or failure.
static void setPermitAccess(PermitRecord permitAccess,
optional EmptyCallback callback);
// Gets the permit record for the local device.
static void getPermitAccess(GetPermitAccessCallback callback);
......
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