Commit 218f9a3b authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

Smart Lock: Remove RecordClickOnLockIcon.

This was only used for the EasyUnlock trial which is currently unused
and about to be removed.

R=hansberry@chromium.org

Bug: 899324
Test: none
Change-Id: Ic3b7271a386d26728e7af4e4ea56dfdd6b19c675
Reviewed-on: https://chromium-review.googlesource.com/c/1302696Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603586}
parent 3f9f0c8d
......@@ -181,12 +181,6 @@ void LoginScreenController::HardlockPod(const AccountId& account_id) {
login_screen_client_->HardlockPod(account_id);
}
void LoginScreenController::RecordClickOnLockIcon(const AccountId& account_id) {
if (!login_screen_client_)
return;
login_screen_client_->RecordClickOnLockIcon(account_id);
}
void LoginScreenController::OnFocusPod(const AccountId& account_id) {
if (!login_screen_client_)
return;
......
......@@ -66,7 +66,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
void EnrollUserWithExternalBinary(OnAuthenticateCallback callback);
void AuthenticateUserWithEasyUnlock(const AccountId& account_id);
void HardlockPod(const AccountId& account_id);
void RecordClickOnLockIcon(const AccountId& account_id);
void OnFocusPod(const AccountId& account_id);
void OnNoPodFocused();
void LoadWallpaper(const AccountId& account_id);
......
......@@ -99,11 +99,6 @@ TEST_F(LoginScreenControllerTest, RequestEasyUnlock) {
EXPECT_CALL(*client, HardlockPod(id));
controller->HardlockPod(id);
base::RunLoop().RunUntilIdle();
// Verify RecordClickOnLockIcon mojo call is run with the same account id.
EXPECT_CALL(*client, RecordClickOnLockIcon(id));
controller->RecordClickOnLockIcon(id);
base::RunLoop().RunUntilIdle();
}
TEST_F(LoginScreenControllerTest, RequestUserPodFocus) {
......
......@@ -67,7 +67,6 @@ class MockLoginScreenClient : public mojom::LoginScreenClient {
MOCK_METHOD1(AuthenticateUserWithEasyUnlock,
void(const AccountId& account_id));
MOCK_METHOD1(HardlockPod, void(const AccountId& account_id));
MOCK_METHOD1(RecordClickOnLockIcon, void(const AccountId& account_id));
MOCK_METHOD1(OnFocusPod, void(const AccountId& account_id));
MOCK_METHOD0(OnNoPodFocused, void());
MOCK_METHOD1(LoadWallpaper, void(const AccountId& account_id));
......
......@@ -251,10 +251,6 @@ interface LoginScreenClient {
// |account_id|: The account id of the user in the user pod.
HardlockPod(signin.mojom.AccountId account_id);
// Record clicks on the lock icon in the user pod.
// |account_id|: The account id of the user in the user pod.
RecordClickOnLockIcon(signin.mojom.AccountId account_id);
// Focus user pod of user with |account_id|.
OnFocusPod(signin.mojom.AccountId account_id);
......
......@@ -223,12 +223,6 @@ void EasyUnlockScreenlockStateHandler::SetTrialRun() {
RecordEasyUnlockTrialRunEvent(EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED);
}
void EasyUnlockScreenlockStateHandler::RecordClickOnLockIcon() {
if (!is_trial_run_)
return;
RecordEasyUnlockTrialRunEvent(EASY_UNLOCK_TRIAL_RUN_EVENT_CLICKED_LOCK_ICON);
}
void EasyUnlockScreenlockStateHandler::OnScreenDidLock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) {
did_see_locked_phone_ = IsLockedState(state_);
......
......@@ -65,10 +65,6 @@ class EasyUnlockScreenlockStateHandler
// Marks the current screenlock state as the one for trial Easy Unlock run.
void SetTrialRun();
// Records that the user clicked on the lock icon during the trial run
// initiated by the Easy Unlock app.
void RecordClickOnLockIcon();
proximity_auth::ScreenlockState state() const { return state_; }
private:
......
......@@ -719,27 +719,5 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, NoOverrideOnlineSignin) {
}
}
TEST_F(EasyUnlockScreenlockStateHandlerTest, TrialRunMetrics) {
base::HistogramTester histogram_tester;
// Simulate the user clicking on the lock icon twice outside of a trial run.
// No trial run metrics should be recorded.
state_handler_->RecordClickOnLockIcon();
state_handler_->RecordClickOnLockIcon();
histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 0);
// Simulate the user clicking on the lock icon three times during a trial run.
state_handler_->SetTrialRun();
state_handler_->RecordClickOnLockIcon();
state_handler_->RecordClickOnLockIcon();
state_handler_->RecordClickOnLockIcon();
histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 4);
histogram_tester.ExpectBucketCount("EasyUnlock.TrialRun.Events",
EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED, 1);
histogram_tester.ExpectBucketCount(
"EasyUnlock.TrialRun.Events",
EASY_UNLOCK_TRIAL_RUN_EVENT_CLICKED_LOCK_ICON, 3);
}
} // namespace
} // namespace chromeos
......@@ -502,11 +502,6 @@ void EasyUnlockService::SetTrialRun() {
handler->SetTrialRun();
}
void EasyUnlockService::RecordClickOnLockIcon() {
if (screenlock_state_handler_)
screenlock_state_handler_->RecordClickOnLockIcon();
}
void EasyUnlockService::AddObserver(EasyUnlockServiceObserver* observer) {
observers_.AddObserver(observer);
}
......
......@@ -187,10 +187,6 @@ class EasyUnlockService : public KeyedService {
// trial run initiated by Easy Unlock app.
void SetTrialRun();
// Records that the user clicked on the lock icon during the trial run
// initiated by the Easy Unlock app.
void RecordClickOnLockIcon();
// Called when the user reauths (e.g. in chrome://settings) so we can cache
// the user context for the setup flow.
virtual void HandleUserReauth(const UserContext& user_context);
......
......@@ -252,11 +252,6 @@ void ViewsScreenLocker::HandleHardlockPod(const AccountId& account_id) {
user_selection_screen_->HardLockPod(account_id);
}
void ViewsScreenLocker::HandleRecordClickOnLockIcon(
const AccountId& account_id) {
user_selection_screen_->RecordClickOnLockIcon(account_id);
}
void ViewsScreenLocker::HandleOnFocusPod(const AccountId& account_id) {
proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(account_id);
if (user_selection_screen_)
......
......@@ -68,7 +68,6 @@ class ViewsScreenLocker : public LoginScreenClient::Delegate,
void HandleAuthenticateUserWithEasyUnlock(
const AccountId& account_id) override;
void HandleHardlockPod(const AccountId& account_id) override;
void HandleRecordClickOnLockIcon(const AccountId& account_id) override;
void HandleOnFocusPod(const AccountId& account_id) override;
void HandleOnNoPodFocused() override;
bool HandleFocusLockScreenApps(bool reverse) override;
......
......@@ -752,13 +752,6 @@ void UserSelectionScreen::AttemptEasyUnlock(const AccountId& account_id) {
service->AttemptAuth(account_id);
}
void UserSelectionScreen::RecordClickOnLockIcon(const AccountId& account_id) {
EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id);
if (!service)
return;
service->RecordClickOnLockIcon();
}
std::unique_ptr<base::ListValue>
UserSelectionScreen::UpdateAndReturnUserListForWebUI() {
std::unique_ptr<base::ListValue> users_list =
......
......@@ -63,7 +63,6 @@ class UserSelectionScreen
// Methods for easy unlock support.
void HardLockPod(const AccountId& account_id);
void AttemptEasyUnlock(const AccountId& account_id);
void RecordClickOnLockIcon(const AccountId& account_id);
// ui::UserActivityDetector implementation:
void OnUserActivity(const ui::Event* event) override;
......
......@@ -395,11 +395,6 @@ void LoginDisplayHostMojo::HandleHardlockPod(const AccountId& account_id) {
user_selection_screen_->HardLockPod(account_id);
}
void LoginDisplayHostMojo::HandleRecordClickOnLockIcon(
const AccountId& account_id) {
user_selection_screen_->RecordClickOnLockIcon(account_id);
}
void LoginDisplayHostMojo::HandleOnFocusPod(const AccountId& account_id) {
// TODO(jdufault): Share common code between this and
// ViewsScreenLocker::HandleOnFocusPod See https://crbug.com/831787.
......
......@@ -111,7 +111,6 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon,
void HandleAuthenticateUserWithEasyUnlock(
const AccountId& account_id) override;
void HandleHardlockPod(const AccountId& account_id) override;
void HandleRecordClickOnLockIcon(const AccountId& account_id) override;
void HandleOnFocusPod(const AccountId& account_id) override;
void HandleOnNoPodFocused() override;
bool HandleFocusLockScreenApps(bool reverse) override;
......
......@@ -125,11 +125,6 @@ void LoginScreenClient::HardlockPod(const AccountId& account_id) {
delegate_->HandleHardlockPod(account_id);
}
void LoginScreenClient::RecordClickOnLockIcon(const AccountId& account_id) {
if (delegate_)
delegate_->HandleRecordClickOnLockIcon(account_id);
}
void LoginScreenClient::OnFocusPod(const AccountId& account_id) {
if (delegate_)
delegate_->HandleOnFocusPod(account_id);
......
......@@ -43,7 +43,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient {
virtual void HandleAuthenticateUserWithEasyUnlock(
const AccountId& account_id) = 0;
virtual void HandleHardlockPod(const AccountId& account_id) = 0;
virtual void HandleRecordClickOnLockIcon(const AccountId& account_id) = 0;
virtual void HandleOnFocusPod(const AccountId& account_id) = 0;
virtual void HandleOnNoPodFocused() = 0;
// Handles request to focus a lock screen app window. Returns whether the
......@@ -86,7 +85,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient {
EnrollUserWithExternalBinaryCallback callback) override;
void AuthenticateUserWithEasyUnlock(const AccountId& account_id) override;
void HardlockPod(const AccountId& account_id) override;
void RecordClickOnLockIcon(const AccountId& account_id) override;
void OnFocusPod(const AccountId& account_id) override;
void OnNoPodFocused() override;
void LoadWallpaper(const AccountId& account_id) override;
......
......@@ -22,8 +22,6 @@ void UserBoardScreenHandler::DeclareLocalizedValues(
void UserBoardScreenHandler::RegisterMessages() {
AddCallback("attemptUnlock", &UserBoardScreenHandler::HandleAttemptUnlock);
AddCallback("hardlockPod", &UserBoardScreenHandler::HandleHardlockPod);
AddCallback("recordClickOnLockIcon",
&UserBoardScreenHandler::HandleRecordClickOnLockIcon);
}
void UserBoardScreenHandler::Initialize() {
......@@ -41,12 +39,6 @@ void UserBoardScreenHandler::HandleAttemptUnlock(const AccountId& account_id) {
screen_->AttemptEasyUnlock(account_id);
}
void UserBoardScreenHandler::HandleRecordClickOnLockIcon(
const AccountId& account_id) {
CHECK(screen_);
screen_->RecordClickOnLockIcon(account_id);
}
//----------------- API
void UserBoardScreenHandler::SetPublicSessionDisplayName(
......
......@@ -36,7 +36,6 @@ class UserBoardScreenHandler : public BaseScreenHandler, public UserBoardView {
// Handlers
void HandleHardlockPod(const AccountId& account_id);
void HandleAttemptUnlock(const AccountId& account_id);
void HandleRecordClickOnLockIcon(const AccountId& account_id);
// UserBoardView implementation:
void SetPublicSessionDisplayName(const AccountId& account_id,
......
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