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) { ...@@ -181,12 +181,6 @@ void LoginScreenController::HardlockPod(const AccountId& account_id) {
login_screen_client_->HardlockPod(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) { void LoginScreenController::OnFocusPod(const AccountId& account_id) {
if (!login_screen_client_) if (!login_screen_client_)
return; return;
......
...@@ -66,7 +66,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen { ...@@ -66,7 +66,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen {
void EnrollUserWithExternalBinary(OnAuthenticateCallback callback); void EnrollUserWithExternalBinary(OnAuthenticateCallback callback);
void AuthenticateUserWithEasyUnlock(const AccountId& account_id); void AuthenticateUserWithEasyUnlock(const AccountId& account_id);
void HardlockPod(const AccountId& account_id); void HardlockPod(const AccountId& account_id);
void RecordClickOnLockIcon(const AccountId& account_id);
void OnFocusPod(const AccountId& account_id); void OnFocusPod(const AccountId& account_id);
void OnNoPodFocused(); void OnNoPodFocused();
void LoadWallpaper(const AccountId& account_id); void LoadWallpaper(const AccountId& account_id);
......
...@@ -99,11 +99,6 @@ TEST_F(LoginScreenControllerTest, RequestEasyUnlock) { ...@@ -99,11 +99,6 @@ TEST_F(LoginScreenControllerTest, RequestEasyUnlock) {
EXPECT_CALL(*client, HardlockPod(id)); EXPECT_CALL(*client, HardlockPod(id));
controller->HardlockPod(id); controller->HardlockPod(id);
base::RunLoop().RunUntilIdle(); 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) { TEST_F(LoginScreenControllerTest, RequestUserPodFocus) {
......
...@@ -67,7 +67,6 @@ class MockLoginScreenClient : public mojom::LoginScreenClient { ...@@ -67,7 +67,6 @@ class MockLoginScreenClient : public mojom::LoginScreenClient {
MOCK_METHOD1(AuthenticateUserWithEasyUnlock, MOCK_METHOD1(AuthenticateUserWithEasyUnlock,
void(const AccountId& account_id)); void(const AccountId& account_id));
MOCK_METHOD1(HardlockPod, 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_METHOD1(OnFocusPod, void(const AccountId& account_id));
MOCK_METHOD0(OnNoPodFocused, void()); MOCK_METHOD0(OnNoPodFocused, void());
MOCK_METHOD1(LoadWallpaper, void(const AccountId& account_id)); MOCK_METHOD1(LoadWallpaper, void(const AccountId& account_id));
......
...@@ -251,10 +251,6 @@ interface LoginScreenClient { ...@@ -251,10 +251,6 @@ interface LoginScreenClient {
// |account_id|: The account id of the user in the user pod. // |account_id|: The account id of the user in the user pod.
HardlockPod(signin.mojom.AccountId account_id); 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|. // Focus user pod of user with |account_id|.
OnFocusPod(signin.mojom.AccountId account_id); OnFocusPod(signin.mojom.AccountId account_id);
......
...@@ -223,12 +223,6 @@ void EasyUnlockScreenlockStateHandler::SetTrialRun() { ...@@ -223,12 +223,6 @@ void EasyUnlockScreenlockStateHandler::SetTrialRun() {
RecordEasyUnlockTrialRunEvent(EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED); 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( void EasyUnlockScreenlockStateHandler::OnScreenDidLock(
proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) { proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) {
did_see_locked_phone_ = IsLockedState(state_); did_see_locked_phone_ = IsLockedState(state_);
......
...@@ -65,10 +65,6 @@ class EasyUnlockScreenlockStateHandler ...@@ -65,10 +65,6 @@ class EasyUnlockScreenlockStateHandler
// Marks the current screenlock state as the one for trial Easy Unlock run. // Marks the current screenlock state as the one for trial Easy Unlock run.
void SetTrialRun(); 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_; } proximity_auth::ScreenlockState state() const { return state_; }
private: private:
......
...@@ -719,27 +719,5 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, NoOverrideOnlineSignin) { ...@@ -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
} // namespace chromeos } // namespace chromeos
...@@ -502,11 +502,6 @@ void EasyUnlockService::SetTrialRun() { ...@@ -502,11 +502,6 @@ void EasyUnlockService::SetTrialRun() {
handler->SetTrialRun(); handler->SetTrialRun();
} }
void EasyUnlockService::RecordClickOnLockIcon() {
if (screenlock_state_handler_)
screenlock_state_handler_->RecordClickOnLockIcon();
}
void EasyUnlockService::AddObserver(EasyUnlockServiceObserver* observer) { void EasyUnlockService::AddObserver(EasyUnlockServiceObserver* observer) {
observers_.AddObserver(observer); observers_.AddObserver(observer);
} }
......
...@@ -187,10 +187,6 @@ class EasyUnlockService : public KeyedService { ...@@ -187,10 +187,6 @@ class EasyUnlockService : public KeyedService {
// trial run initiated by Easy Unlock app. // trial run initiated by Easy Unlock app.
void SetTrialRun(); 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 // Called when the user reauths (e.g. in chrome://settings) so we can cache
// the user context for the setup flow. // the user context for the setup flow.
virtual void HandleUserReauth(const UserContext& user_context); virtual void HandleUserReauth(const UserContext& user_context);
......
...@@ -252,11 +252,6 @@ void ViewsScreenLocker::HandleHardlockPod(const AccountId& account_id) { ...@@ -252,11 +252,6 @@ void ViewsScreenLocker::HandleHardlockPod(const AccountId& account_id) {
user_selection_screen_->HardLockPod(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) { void ViewsScreenLocker::HandleOnFocusPod(const AccountId& account_id) {
proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(account_id); proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(account_id);
if (user_selection_screen_) if (user_selection_screen_)
......
...@@ -68,7 +68,6 @@ class ViewsScreenLocker : public LoginScreenClient::Delegate, ...@@ -68,7 +68,6 @@ class ViewsScreenLocker : public LoginScreenClient::Delegate,
void HandleAuthenticateUserWithEasyUnlock( void HandleAuthenticateUserWithEasyUnlock(
const AccountId& account_id) override; const AccountId& account_id) override;
void HandleHardlockPod(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 HandleOnFocusPod(const AccountId& account_id) override;
void HandleOnNoPodFocused() override; void HandleOnNoPodFocused() override;
bool HandleFocusLockScreenApps(bool reverse) override; bool HandleFocusLockScreenApps(bool reverse) override;
......
...@@ -752,13 +752,6 @@ void UserSelectionScreen::AttemptEasyUnlock(const AccountId& account_id) { ...@@ -752,13 +752,6 @@ void UserSelectionScreen::AttemptEasyUnlock(const AccountId& account_id) {
service->AttemptAuth(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> std::unique_ptr<base::ListValue>
UserSelectionScreen::UpdateAndReturnUserListForWebUI() { UserSelectionScreen::UpdateAndReturnUserListForWebUI() {
std::unique_ptr<base::ListValue> users_list = std::unique_ptr<base::ListValue> users_list =
......
...@@ -63,7 +63,6 @@ class UserSelectionScreen ...@@ -63,7 +63,6 @@ class UserSelectionScreen
// Methods for easy unlock support. // Methods for easy unlock support.
void HardLockPod(const AccountId& account_id); void HardLockPod(const AccountId& account_id);
void AttemptEasyUnlock(const AccountId& account_id); void AttemptEasyUnlock(const AccountId& account_id);
void RecordClickOnLockIcon(const AccountId& account_id);
// ui::UserActivityDetector implementation: // ui::UserActivityDetector implementation:
void OnUserActivity(const ui::Event* event) override; void OnUserActivity(const ui::Event* event) override;
......
...@@ -395,11 +395,6 @@ void LoginDisplayHostMojo::HandleHardlockPod(const AccountId& account_id) { ...@@ -395,11 +395,6 @@ void LoginDisplayHostMojo::HandleHardlockPod(const AccountId& account_id) {
user_selection_screen_->HardLockPod(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) { void LoginDisplayHostMojo::HandleOnFocusPod(const AccountId& account_id) {
// TODO(jdufault): Share common code between this and // TODO(jdufault): Share common code between this and
// ViewsScreenLocker::HandleOnFocusPod See https://crbug.com/831787. // ViewsScreenLocker::HandleOnFocusPod See https://crbug.com/831787.
......
...@@ -111,7 +111,6 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon, ...@@ -111,7 +111,6 @@ class LoginDisplayHostMojo : public LoginDisplayHostCommon,
void HandleAuthenticateUserWithEasyUnlock( void HandleAuthenticateUserWithEasyUnlock(
const AccountId& account_id) override; const AccountId& account_id) override;
void HandleHardlockPod(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 HandleOnFocusPod(const AccountId& account_id) override;
void HandleOnNoPodFocused() override; void HandleOnNoPodFocused() override;
bool HandleFocusLockScreenApps(bool reverse) override; bool HandleFocusLockScreenApps(bool reverse) override;
......
...@@ -125,11 +125,6 @@ void LoginScreenClient::HardlockPod(const AccountId& account_id) { ...@@ -125,11 +125,6 @@ void LoginScreenClient::HardlockPod(const AccountId& account_id) {
delegate_->HandleHardlockPod(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) { void LoginScreenClient::OnFocusPod(const AccountId& account_id) {
if (delegate_) if (delegate_)
delegate_->HandleOnFocusPod(account_id); delegate_->HandleOnFocusPod(account_id);
......
...@@ -43,7 +43,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient { ...@@ -43,7 +43,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient {
virtual void HandleAuthenticateUserWithEasyUnlock( virtual void HandleAuthenticateUserWithEasyUnlock(
const AccountId& account_id) = 0; const AccountId& account_id) = 0;
virtual void HandleHardlockPod(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 HandleOnFocusPod(const AccountId& account_id) = 0;
virtual void HandleOnNoPodFocused() = 0; virtual void HandleOnNoPodFocused() = 0;
// Handles request to focus a lock screen app window. Returns whether the // Handles request to focus a lock screen app window. Returns whether the
...@@ -86,7 +85,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient { ...@@ -86,7 +85,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient {
EnrollUserWithExternalBinaryCallback callback) override; EnrollUserWithExternalBinaryCallback callback) override;
void AuthenticateUserWithEasyUnlock(const AccountId& account_id) override; void AuthenticateUserWithEasyUnlock(const AccountId& account_id) override;
void HardlockPod(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 OnFocusPod(const AccountId& account_id) override;
void OnNoPodFocused() override; void OnNoPodFocused() override;
void LoadWallpaper(const AccountId& account_id) override; void LoadWallpaper(const AccountId& account_id) override;
......
...@@ -22,8 +22,6 @@ void UserBoardScreenHandler::DeclareLocalizedValues( ...@@ -22,8 +22,6 @@ void UserBoardScreenHandler::DeclareLocalizedValues(
void UserBoardScreenHandler::RegisterMessages() { void UserBoardScreenHandler::RegisterMessages() {
AddCallback("attemptUnlock", &UserBoardScreenHandler::HandleAttemptUnlock); AddCallback("attemptUnlock", &UserBoardScreenHandler::HandleAttemptUnlock);
AddCallback("hardlockPod", &UserBoardScreenHandler::HandleHardlockPod); AddCallback("hardlockPod", &UserBoardScreenHandler::HandleHardlockPod);
AddCallback("recordClickOnLockIcon",
&UserBoardScreenHandler::HandleRecordClickOnLockIcon);
} }
void UserBoardScreenHandler::Initialize() { void UserBoardScreenHandler::Initialize() {
...@@ -41,12 +39,6 @@ void UserBoardScreenHandler::HandleAttemptUnlock(const AccountId& account_id) { ...@@ -41,12 +39,6 @@ void UserBoardScreenHandler::HandleAttemptUnlock(const AccountId& account_id) {
screen_->AttemptEasyUnlock(account_id); screen_->AttemptEasyUnlock(account_id);
} }
void UserBoardScreenHandler::HandleRecordClickOnLockIcon(
const AccountId& account_id) {
CHECK(screen_);
screen_->RecordClickOnLockIcon(account_id);
}
//----------------- API //----------------- API
void UserBoardScreenHandler::SetPublicSessionDisplayName( void UserBoardScreenHandler::SetPublicSessionDisplayName(
......
...@@ -36,7 +36,6 @@ class UserBoardScreenHandler : public BaseScreenHandler, public UserBoardView { ...@@ -36,7 +36,6 @@ class UserBoardScreenHandler : public BaseScreenHandler, public UserBoardView {
// Handlers // Handlers
void HandleHardlockPod(const AccountId& account_id); void HandleHardlockPod(const AccountId& account_id);
void HandleAttemptUnlock(const AccountId& account_id); void HandleAttemptUnlock(const AccountId& account_id);
void HandleRecordClickOnLockIcon(const AccountId& account_id);
// UserBoardView implementation: // UserBoardView implementation:
void SetPublicSessionDisplayName(const AccountId& account_id, 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