Commit 36380357 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Revert "cros: Views login/lock clear password when switching active auth user."

This reverts commit 86a87223.

Reason for revert:
ash_unittests LoginAuthUserViewUnittest.PasswordClearedAfterAnimationIfPasswordDisabled
has been failing on linux-chromeos-dbg since this landed in
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/linux-chromeos-dbg/6443

Original change's description:
> cros: Views login/lock clear password when switching active auth user.
> 
> Bug: 855725
> Change-Id: I91f6bab46701c9d66bc8b497661c460a7968619f
> Reviewed-on: https://chromium-review.googlesource.com/1112075
> Commit-Queue: Jacob Dufault <jdufault@chromium.org>
> Reviewed-by: Xiaoyin Hu <xiaoyinh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#569802}

TBR=jdufault@chromium.org,xiaoyinh@chromium.org

Change-Id: I7a54ed3ba91ea6a9adb46f83852488ed1c76178c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 855725
Reviewed-on: https://chromium-review.googlesource.com/1112980Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569882}
parent b585fd98
......@@ -101,26 +101,6 @@ ui::CallbackLayerAnimationObserver* BuildObserverToHideView(views::View* view) {
view));
}
// Clears the password for the given |LoginPasswordView| instance and then
// deletes itself.
class ClearPasswordAnimationObserver : public ui::ImplicitAnimationObserver {
public:
explicit ClearPasswordAnimationObserver(LoginPasswordView* view)
: view_(view) {}
~ClearPasswordAnimationObserver() override = default;
// ui::ImplicitAnimationObserver:
void OnImplicitAnimationsCompleted() override {
view_->Clear();
delete this;
}
private:
LoginPasswordView* view_;
DISALLOW_COPY_AND_ASSIGN(ClearPasswordAnimationObserver);
};
// A view which has a round border and a fingerprint icon at the center.
class FingerprintIconView : public views::View {
public:
......@@ -568,10 +548,6 @@ void LoginAuthUserView::ApplyAnimationPostLayout() {
settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
login_constants::kChangeUserAnimationDurationMs));
settings.SetTweenType(gfx::Tween::Type::FAST_OUT_SLOW_IN);
if (cached_animation_state_->had_password && !has_password) {
settings.AddObserver(
new ClearPasswordAnimationObserver(password_view_));
}
password_view_->layer()->SetOpacity(opacity_end);
}
......
......@@ -12,7 +12,6 @@
#include "ash/strings/grit/ash_strings.h"
#include "base/bind_helpers.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/event_utils.h"
......@@ -164,32 +163,4 @@ TEST_F(LoginAuthUserViewUnittest, OnlineSignInMessage) {
EXPECT_FALSE(online_sign_in_message->visible());
}
// Verifies that password is cleared after AUTH_PASSWORD is disabled.
TEST_F(LoginAuthUserViewUnittest,
PasswordClearedAfterAnimationIfPasswordDisabled) {
LoginPasswordView::TestApi password_test(view_->password_view());
auto has_password = [&]() {
return !password_test.textfield()->text().empty();
};
// Set a password.
view_->SetAuthMethods(LoginAuthUserView::AUTH_PASSWORD);
password_test.textfield()->SetText(base::ASCIIToUTF16("Hello"));
// Enable some other auth method (PIN), password is not cleared.
view_->CaptureStateForAnimationPreLayout();
view_->SetAuthMethods(LoginAuthUserView::AUTH_PASSWORD |
LoginAuthUserView::AUTH_PIN);
EXPECT_TRUE(has_password());
view_->ApplyAnimationPostLayout();
EXPECT_TRUE(has_password());
// Disable password, password is cleared.
view_->CaptureStateForAnimationPreLayout();
view_->SetAuthMethods(LoginAuthUserView::AUTH_NONE);
EXPECT_TRUE(has_password());
view_->ApplyAnimationPostLayout();
EXPECT_FALSE(has_password());
}
} // namespace ash
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