summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorxiyuan <xiyuan@chromium.org>2014-11-20 15:10:38 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-20 23:12:09 +0000
commitefe4158e426e1ddc7bfc7ba948b9ca6beaa4573a (patch)
treedeb5873e33c93957dd184273650732ab68eb1b27 /chrome/browser
parentbebcbc64bef44e63cbe88db487fb76ff383334f0 (diff)
downloadchromium_src-efe4158e426e1ddc7bfc7ba948b9ca6beaa4573a.zip
chromium_src-efe4158e426e1ddc7bfc7ba948b9ca6beaa4573a.tar.gz
chromium_src-efe4158e426e1ddc7bfc7ba948b9ca6beaa4573a.tar.bz2
easy-unlock: Do not show icon for online auth type.
BUG=433912 Review URL: https://codereview.chromium.org/749563002 Cr-Commit-Position: refs/heads/master@{#305106}
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/signin/easy_unlock_screenlock_state_handler.cc9
-rw-r--r--chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc2
2 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc
index cc0ff76..96d53cf 100644
--- a/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc
+++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc
@@ -119,6 +119,12 @@ void EasyUnlockScreenlockStateHandler::ChangeState(State new_state) {
if (!screenlock_bridge_->IsLocked())
return;
+ // Do nothing when auth type is online.
+ if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) ==
+ ScreenlockBridge::LockHandler::ONLINE_SIGN_IN) {
+ return;
+ }
+
// No hardlock UI for trial run.
if (!is_trial_run_ && hardlock_state_ != NO_HARDLOCK) {
ShowHardlockUI();
@@ -313,8 +319,7 @@ void EasyUnlockScreenlockStateHandler::UpdateScreenlockAuthType() {
// Do not override online signin.
const ScreenlockBridge::LockHandler::AuthType existing_auth_type =
screenlock_bridge_->lock_handler()->GetAuthType(user_email_);
- if (existing_auth_type == ScreenlockBridge::LockHandler::ONLINE_SIGN_IN)
- return;
+ DCHECK_NE(ScreenlockBridge::LockHandler::ONLINE_SIGN_IN, existing_auth_type);
if (state_ == STATE_AUTHENTICATED) {
if (existing_auth_type != ScreenlockBridge::LockHandler::USER_CLICK) {
diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
index 0b020f9..36c18b4 100644
--- a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
+++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
@@ -768,6 +768,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, NoOverrideOnlineSignin) {
state_handler_->ChangeState(states[i]);
EXPECT_EQ(ScreenlockBridge::LockHandler::ONLINE_SIGN_IN,
lock_handler_->GetAuthType(user_email_));
+ EXPECT_FALSE(lock_handler_->HasCustomIcon());
}
std::vector<EasyUnlockScreenlockStateHandler::HardlockState> hardlock_states;
@@ -782,6 +783,7 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, NoOverrideOnlineSignin) {
state_handler_->SetHardlockState(hardlock_states[i]);
EXPECT_EQ(ScreenlockBridge::LockHandler::ONLINE_SIGN_IN,
lock_handler_->GetAuthType(user_email_));
+ EXPECT_FALSE(lock_handler_->HasCustomIcon());
}
}