[SmartLock] Delete hardlock icon tap callback
Now that Sign in with Smart Lock is deprecated there is no use for hardlock. This CL deletes the EasyUnlock icon tap callback which is supposed to trigger hardlock. Hardlock and the EasyUnlockIcon is doubly irrelevant since the SmartLockUIRevamp is also fully ramped up already. Follow up CLs will delete Hardlock UI, state management, and user prefs. TEST=existing unittests test and manually tested smart lock with strongbad and pixel4a Change-Id: I2c4ad2c6d491bc7660ac339e30dca02e4b16c7ac Bug: b/227674947 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4358450 Commit-Queue: Brittany Hartmire <bhartmire@google.com> Reviewed-by: Ryan Hansberry <hansberry@chromium.org> Reviewed-by: Toni Barzic <tbarzic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1121938}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
984cfc3e93
commit
e94bd8429d
ash
in_session_auth
login
ui
public
chrome/browser/ash/login
chromeos/ash/components/proximity_auth
@@ -470,7 +470,7 @@ void AuthDialogContentsView::AddPasswordView() {
|
|||||||
/*authenticated_by_pin=*/false),
|
/*authenticated_by_pin=*/false),
|
||||||
base::BindRepeating(&AuthDialogContentsView::OnInputTextChanged,
|
base::BindRepeating(&AuthDialogContentsView::OnInputTextChanged,
|
||||||
base::Unretained(this)),
|
base::Unretained(this)),
|
||||||
base::DoNothing(), views::Button::PressedCallback());
|
base::DoNothing());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AuthDialogContentsView::AddPinPadView() {
|
void AuthDialogContentsView::AddPinPadView() {
|
||||||
@@ -503,7 +503,7 @@ void AuthDialogContentsView::AddPinPadView() {
|
|||||||
/*authenticated_by_pin=*/true),
|
/*authenticated_by_pin=*/true),
|
||||||
base::BindRepeating(&AuthDialogContentsView::OnInputTextChanged,
|
base::BindRepeating(&AuthDialogContentsView::OnInputTextChanged,
|
||||||
base::Unretained(this)),
|
base::Unretained(this)),
|
||||||
base::DoNothing(), views::Button::PressedCallback());
|
base::DoNothing());
|
||||||
}
|
}
|
||||||
pin_pad_view_->SetVisible(true);
|
pin_pad_view_->SetVisible(true);
|
||||||
}
|
}
|
||||||
|
@@ -2242,21 +2242,6 @@ void LockContentsView::OnEasyUnlockIconHovered() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LockContentsView::OnEasyUnlockIconTapped() {
|
|
||||||
UserState* state = FindStateForUser(
|
|
||||||
CurrentBigUserView()->GetCurrentUser().basic_user_info.account_id);
|
|
||||||
DCHECK(state);
|
|
||||||
DCHECK(state->easy_unlock_icon_info);
|
|
||||||
|
|
||||||
if (state->easy_unlock_icon_info->hardlock_on_click) {
|
|
||||||
AccountId user =
|
|
||||||
CurrentBigUserView()->GetCurrentUser().basic_user_info.account_id;
|
|
||||||
Shell::Get()->login_screen_controller()->HardlockPod(user);
|
|
||||||
// TODO(jdufault): This should get called as a result of HardlockPod.
|
|
||||||
OnTapToUnlockEnabledForUserChanged(user, false /*enabled*/);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LockContentsView::OnParentAccessValidationFinished(
|
void LockContentsView::OnParentAccessValidationFinished(
|
||||||
const AccountId& account_id,
|
const AccountId& account_id,
|
||||||
bool access_granted) {
|
bool access_granted) {
|
||||||
@@ -2343,8 +2328,6 @@ std::unique_ptr<LoginBigUserView> LockContentsView::AllocateLoginBigUserView(
|
|||||||
&LockContentsView::RemoveUser, base::Unretained(this), is_primary);
|
&LockContentsView::RemoveUser, base::Unretained(this), is_primary);
|
||||||
auth_user_callbacks.on_easy_unlock_icon_hovered = base::BindRepeating(
|
auth_user_callbacks.on_easy_unlock_icon_hovered = base::BindRepeating(
|
||||||
&LockContentsView::OnEasyUnlockIconHovered, base::Unretained(this));
|
&LockContentsView::OnEasyUnlockIconHovered, base::Unretained(this));
|
||||||
auth_user_callbacks.on_easy_unlock_icon_tapped = base::BindRepeating(
|
|
||||||
&LockContentsView::OnEasyUnlockIconTapped, base::Unretained(this));
|
|
||||||
auth_user_callbacks.on_auth_factor_is_hiding_password_changed =
|
auth_user_callbacks.on_auth_factor_is_hiding_password_changed =
|
||||||
base::BindRepeating(
|
base::BindRepeating(
|
||||||
&LockContentsView::OnAuthFactorIsHidingPasswordChanged,
|
&LockContentsView::OnAuthFactorIsHidingPasswordChanged,
|
||||||
|
@@ -343,8 +343,6 @@ class ASH_EXPORT LockContentsView
|
|||||||
|
|
||||||
// Called when the easy unlock icon is hovered.
|
// Called when the easy unlock icon is hovered.
|
||||||
void OnEasyUnlockIconHovered();
|
void OnEasyUnlockIconHovered();
|
||||||
// Called when the easy unlock icon is tapped.
|
|
||||||
void OnEasyUnlockIconTapped();
|
|
||||||
|
|
||||||
// Called when LoginAuthFactorsView enters/exits a state where an auth
|
// Called when LoginAuthFactorsView enters/exits a state where an auth
|
||||||
// factor wants to hide the password and pin fields.
|
// factor wants to hide the password and pin fields.
|
||||||
|
@@ -1047,8 +1047,7 @@ LoginAuthUserView::LoginAuthUserView(const LoginUserInfo& user,
|
|||||||
base::Unretained(this)),
|
base::Unretained(this)),
|
||||||
base::BindRepeating(&LoginAuthUserView::OnPasswordTextChanged,
|
base::BindRepeating(&LoginAuthUserView::OnPasswordTextChanged,
|
||||||
base::Unretained(this)),
|
base::Unretained(this)),
|
||||||
callbacks.on_easy_unlock_icon_hovered,
|
callbacks.on_easy_unlock_icon_hovered);
|
||||||
callbacks.on_easy_unlock_icon_tapped);
|
|
||||||
|
|
||||||
auto pin_input_view = std::make_unique<LoginPinInputView>();
|
auto pin_input_view = std::make_unique<LoginPinInputView>();
|
||||||
pin_input_view_ = pin_input_view.get();
|
pin_input_view_ = pin_input_view.get();
|
||||||
|
@@ -146,8 +146,6 @@ class ASH_EXPORT LoginAuthUserView : public NonAccessibleView {
|
|||||||
LoginUserView::OnRemove on_remove;
|
LoginUserView::OnRemove on_remove;
|
||||||
// Called when the easy unlock icon is hovered.
|
// Called when the easy unlock icon is hovered.
|
||||||
OnEasyUnlockIconHovered on_easy_unlock_icon_hovered;
|
OnEasyUnlockIconHovered on_easy_unlock_icon_hovered;
|
||||||
// Called when the easy unlock icon is tapped.
|
|
||||||
views::Button::PressedCallback on_easy_unlock_icon_tapped;
|
|
||||||
// Called when LoginAuthFactorsView enters/exits a state where an auth
|
// Called when LoginAuthFactorsView enters/exits a state where an auth
|
||||||
// factor wants to hide the password and pin.
|
// factor wants to hide the password and pin.
|
||||||
base::RepeatingCallback<void(bool)>
|
base::RepeatingCallback<void(bool)>
|
||||||
|
@@ -114,8 +114,6 @@ class LoginAuthUserViewTestBase : public LoginTestBase {
|
|||||||
LoginAuthUserView::Callbacks auth_callbacks;
|
LoginAuthUserView::Callbacks auth_callbacks;
|
||||||
auth_callbacks.on_auth = base::DoNothing();
|
auth_callbacks.on_auth = base::DoNothing();
|
||||||
auth_callbacks.on_easy_unlock_icon_hovered = base::DoNothing();
|
auth_callbacks.on_easy_unlock_icon_hovered = base::DoNothing();
|
||||||
auth_callbacks.on_easy_unlock_icon_tapped =
|
|
||||||
views::Button::PressedCallback();
|
|
||||||
auth_callbacks.on_tap = base::DoNothing();
|
auth_callbacks.on_tap = base::DoNothing();
|
||||||
auth_callbacks.on_remove_warning_shown = base::DoNothing();
|
auth_callbacks.on_remove_warning_shown = base::DoNothing();
|
||||||
auth_callbacks.on_remove = base::DoNothing();
|
auth_callbacks.on_remove = base::DoNothing();
|
||||||
|
@@ -315,12 +315,10 @@ class LoginPasswordView::EasyUnlockIcon : public views::ImageButton {
|
|||||||
|
|
||||||
~EasyUnlockIcon() override = default;
|
~EasyUnlockIcon() override = default;
|
||||||
|
|
||||||
void Init(const OnEasyUnlockIconHovered& on_hovered,
|
void Init(const OnEasyUnlockIconHovered& on_hovered) {
|
||||||
views::Button::PressedCallback on_tapped) {
|
|
||||||
DCHECK(on_hovered);
|
DCHECK(on_hovered);
|
||||||
|
|
||||||
on_hovered_ = on_hovered;
|
on_hovered_ = on_hovered;
|
||||||
SetCallback(std::move(on_tapped));
|
|
||||||
|
|
||||||
hover_notifier_ = std::make_unique<HoverNotifier>(
|
hover_notifier_ = std::make_unique<HoverNotifier>(
|
||||||
this, base::BindRepeating(
|
this, base::BindRepeating(
|
||||||
@@ -687,14 +685,12 @@ LoginPasswordView::~LoginPasswordView() {
|
|||||||
void LoginPasswordView::Init(
|
void LoginPasswordView::Init(
|
||||||
const OnPasswordSubmit& on_submit,
|
const OnPasswordSubmit& on_submit,
|
||||||
const OnPasswordTextChanged& on_password_text_changed,
|
const OnPasswordTextChanged& on_password_text_changed,
|
||||||
const OnEasyUnlockIconHovered& on_easy_unlock_icon_hovered,
|
const OnEasyUnlockIconHovered& on_easy_unlock_icon_hovered) {
|
||||||
views::Button::PressedCallback on_easy_unlock_icon_tapped) {
|
|
||||||
DCHECK(on_submit);
|
DCHECK(on_submit);
|
||||||
DCHECK(on_password_text_changed);
|
DCHECK(on_password_text_changed);
|
||||||
on_submit_ = on_submit;
|
on_submit_ = on_submit;
|
||||||
on_password_text_changed_ = on_password_text_changed;
|
on_password_text_changed_ = on_password_text_changed;
|
||||||
easy_unlock_icon_->Init(on_easy_unlock_icon_hovered,
|
easy_unlock_icon_->Init(on_easy_unlock_icon_hovered);
|
||||||
std::move(on_easy_unlock_icon_tapped));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginPasswordView::SetEnabledOnEmptyPassword(bool enabled) {
|
void LoginPasswordView::SetEnabledOnEmptyPassword(bool enabled) {
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#include "ui/base/ime/ash/ime_keyboard.h"
|
#include "ui/base/ime/ash/ime_keyboard.h"
|
||||||
#include "ui/base/metadata/metadata_header_macros.h"
|
#include "ui/base/metadata/metadata_header_macros.h"
|
||||||
#include "ui/compositor/layer_animation_observer.h"
|
#include "ui/compositor/layer_animation_observer.h"
|
||||||
#include "ui/views/controls/button/button.h"
|
|
||||||
#include "ui/views/controls/textfield/textfield_controller.h"
|
#include "ui/views/controls/textfield/textfield_controller.h"
|
||||||
#include "ui/views/view.h"
|
#include "ui/views/view.h"
|
||||||
|
|
||||||
@@ -104,8 +103,7 @@ class ASH_EXPORT LoginPasswordView
|
|||||||
// changes.
|
// changes.
|
||||||
void Init(const OnPasswordSubmit& on_submit,
|
void Init(const OnPasswordSubmit& on_submit,
|
||||||
const OnPasswordTextChanged& on_password_text_changed,
|
const OnPasswordTextChanged& on_password_text_changed,
|
||||||
const OnEasyUnlockIconHovered& on_easy_unlock_icon_hovered,
|
const OnEasyUnlockIconHovered& on_easy_unlock_icon_hovered);
|
||||||
views::Button::PressedCallback on_easy_unlock_icon_tapped);
|
|
||||||
|
|
||||||
// Whether or not the password field is enabled when there is no text.
|
// Whether or not the password field is enabled when there is no text.
|
||||||
void SetEnabledOnEmptyPassword(bool enabled);
|
void SetEnabledOnEmptyPassword(bool enabled);
|
||||||
|
@@ -50,8 +50,6 @@ class LoginPasswordViewTest : public LoginTestBase {
|
|||||||
base::BindRepeating(&LoginPasswordViewTest::OnPasswordTextChanged,
|
base::BindRepeating(&LoginPasswordViewTest::OnPasswordTextChanged,
|
||||||
base::Unretained(this)),
|
base::Unretained(this)),
|
||||||
base::BindRepeating(&LoginPasswordViewTest::OnEasyUnlockIconHovered,
|
base::BindRepeating(&LoginPasswordViewTest::OnEasyUnlockIconHovered,
|
||||||
base::Unretained(this)),
|
|
||||||
base::BindRepeating(&LoginPasswordViewTest::OnEasyUnlockIconTapped,
|
|
||||||
base::Unretained(this)));
|
base::Unretained(this)));
|
||||||
|
|
||||||
SetWidget(CreateWidgetWithContent(view_));
|
SetWidget(CreateWidgetWithContent(view_));
|
||||||
@@ -64,7 +62,6 @@ class LoginPasswordViewTest : public LoginTestBase {
|
|||||||
is_password_field_empty_ = is_empty;
|
is_password_field_empty_ = is_empty;
|
||||||
}
|
}
|
||||||
void OnEasyUnlockIconHovered() { easy_unlock_icon_hovered_called_ = true; }
|
void OnEasyUnlockIconHovered() { easy_unlock_icon_hovered_called_ = true; }
|
||||||
void OnEasyUnlockIconTapped() { easy_unlock_icon_tapped_called_ = true; }
|
|
||||||
|
|
||||||
LoginPasswordView* view_ = nullptr;
|
LoginPasswordView* view_ = nullptr;
|
||||||
absl::optional<std::u16string> password_;
|
absl::optional<std::u16string> password_;
|
||||||
|
@@ -173,11 +173,6 @@ struct ASH_PUBLIC_EXPORT EasyUnlockIconInfo {
|
|||||||
// TODO(jdufault): Always populate and use |aria_label|, even if |tooltip| is
|
// TODO(jdufault): Always populate and use |aria_label|, even if |tooltip| is
|
||||||
// non-empty.
|
// non-empty.
|
||||||
std::u16string aria_label;
|
std::u16string aria_label;
|
||||||
// If true, clicking the easy unlock icon should fire a hardlock event which
|
|
||||||
// will disable easy unlock. The hardlock event will request a new icon
|
|
||||||
// display via a separate EasyUnlockIconsOption update. See
|
|
||||||
// LoginScreenClient::HardlockPod.
|
|
||||||
bool hardlock_on_click = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Enterprise information about a managed device.
|
// Enterprise information about a managed device.
|
||||||
|
@@ -65,10 +65,6 @@ proximity_auth::ScreenlockBridge::UserPodCustomIcon GetIconForState(
|
|||||||
return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE;
|
return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HardlockOnClick(SmartLockState state) {
|
|
||||||
return state != SmartLockState::kInactive;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t GetTooltipResourceId(SmartLockState state) {
|
size_t GetTooltipResourceId(SmartLockState state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case SmartLockState::kInactive:
|
case SmartLockState::kInactive:
|
||||||
@@ -191,9 +187,6 @@ void SmartLockStateHandler::ChangeState(SmartLockState new_state) {
|
|||||||
proximity_auth::ScreenlockBridge::UserPodCustomIconInfo icon_info;
|
proximity_auth::ScreenlockBridge::UserPodCustomIconInfo icon_info;
|
||||||
icon_info.SetIcon(icon);
|
icon_info.SetIcon(icon);
|
||||||
|
|
||||||
if (HardlockOnClick(state_))
|
|
||||||
icon_info.SetHardlockOnClick();
|
|
||||||
|
|
||||||
UpdateTooltipOptions(&icon_info);
|
UpdateTooltipOptions(&icon_info);
|
||||||
|
|
||||||
// For states without tooltips, we still need to set an accessibility label.
|
// For states without tooltips, we still need to set an accessibility label.
|
||||||
|
@@ -56,9 +56,6 @@ EasyUnlockIconInfo ToEasyUnlockIconInfo(
|
|||||||
if (!user_pod_icon_info.aria_label().empty())
|
if (!user_pod_icon_info.aria_label().empty())
|
||||||
easy_unlock_icon_info.aria_label = user_pod_icon_info.aria_label();
|
easy_unlock_icon_info.aria_label = user_pod_icon_info.aria_label();
|
||||||
|
|
||||||
if (user_pod_icon_info.hardlock_on_click())
|
|
||||||
easy_unlock_icon_info.hardlock_on_click = true;
|
|
||||||
|
|
||||||
return easy_unlock_icon_info;
|
return easy_unlock_icon_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -74,9 +74,6 @@ base::Value::Dict ScreenlockBridge::UserPodCustomIconInfo::ToDictForTesting()
|
|||||||
if (!aria_label_.empty())
|
if (!aria_label_.empty())
|
||||||
result.Set("ariaLabel", aria_label_);
|
result.Set("ariaLabel", aria_label_);
|
||||||
|
|
||||||
if (hardlock_on_click_)
|
|
||||||
result.Set("hardlockOnClick", true);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,10 +94,6 @@ void ScreenlockBridge::UserPodCustomIconInfo::SetAriaLabel(
|
|||||||
aria_label_ = aria_label;
|
aria_label_ = aria_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenlockBridge::UserPodCustomIconInfo::SetHardlockOnClick() {
|
|
||||||
hardlock_on_click_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string ScreenlockBridge::UserPodCustomIconInfo::GetIDString() const {
|
std::string ScreenlockBridge::UserPodCustomIconInfo::GetIDString() const {
|
||||||
return GetIdForIcon(icon_);
|
return GetIdForIcon(icon_);
|
||||||
}
|
}
|
||||||
|
@@ -66,10 +66,6 @@ class ScreenlockBridge {
|
|||||||
// provided, then the tooltip will be used.
|
// provided, then the tooltip will be used.
|
||||||
void SetAriaLabel(const std::u16string& aria_label);
|
void SetAriaLabel(const std::u16string& aria_label);
|
||||||
|
|
||||||
// If hardlock on click is set, clicking the icon in the screenlock will
|
|
||||||
// go to state where password is required for unlock.
|
|
||||||
void SetHardlockOnClick();
|
|
||||||
|
|
||||||
std::string GetIDString() const;
|
std::string GetIDString() const;
|
||||||
|
|
||||||
UserPodCustomIcon icon() const { return icon_; }
|
UserPodCustomIcon icon() const { return icon_; }
|
||||||
@@ -80,8 +76,6 @@ class ScreenlockBridge {
|
|||||||
|
|
||||||
const std::u16string aria_label() const { return aria_label_; }
|
const std::u16string aria_label() const { return aria_label_; }
|
||||||
|
|
||||||
bool hardlock_on_click() const { return hardlock_on_click_; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UserPodCustomIcon icon_;
|
UserPodCustomIcon icon_;
|
||||||
|
|
||||||
@@ -89,8 +83,6 @@ class ScreenlockBridge {
|
|||||||
bool autoshow_tooltip_ = false;
|
bool autoshow_tooltip_ = false;
|
||||||
|
|
||||||
std::u16string aria_label_;
|
std::u16string aria_label_;
|
||||||
|
|
||||||
bool hardlock_on_click_ = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class LockHandler {
|
class LockHandler {
|
||||||
|
Reference in New Issue
Block a user