Commit 7104fe38 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Chromium LUCI CQ

Rename LoginUIService::ABORT_SIGNIN to LoginUIService::ABORT_SYNC

When the user clicks on "Cancel" on the sync confirmation dialog, only
the sync consent is revoked (the primary acount is *not* cleared), so
it naming the corresponding enum entry ABORT_SYNC instead of ABORT_SIGNIN
is more accurate.

Bug: 1155505
Change-Id: Ibc032c1c7f7e9b5493cdb1f8b4f996152f9d7f8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2578842
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835205}
parent c21127e3
...@@ -213,7 +213,7 @@ void TurnSyncOnHelper::FinishSyncSetup( ...@@ -213,7 +213,7 @@ void TurnSyncOnHelper::FinishSyncSetup(
account_id); account_id);
break; break;
} }
case LoginUIService::ABORT_SIGNIN: case LoginUIService::ABORT_SYNC:
// Chrome OS users stay signed in even if sync setup is cancelled. // Chrome OS users stay signed in even if sync setup is cancelled.
break; break;
} }
......
...@@ -149,7 +149,7 @@ TEST_F(TurnSyncOnHelperTest, UserClicksCancel) { ...@@ -149,7 +149,7 @@ TEST_F(TurnSyncOnHelperTest, UserClicksCancel) {
BrowserList::SetLastActive(browser()); BrowserList::SetLastActive(browser());
// Simulate the user clicking "Cancel". // Simulate the user clicking "Cancel".
helper.OnSyncConfirmationUIClosed(LoginUIService::ABORT_SIGNIN); helper.OnSyncConfirmationUIClosed(LoginUIService::ABORT_SYNC);
// Setup is not complete and we didn't show settings. // Setup is not complete and we didn't show settings.
EXPECT_FALSE(identity_manager()->HasPrimaryAccount(ConsentLevel::kSync)); EXPECT_FALSE(identity_manager()->HasPrimaryAccount(ConsentLevel::kSync));
......
...@@ -396,8 +396,8 @@ IN_PROC_BROWSER_TEST_F(UserPolicySigninServiceTest, UndoSignin) { ...@@ -396,8 +396,8 @@ IN_PROC_BROWSER_TEST_F(UserPolicySigninServiceTest, UndoSignin) {
WaitForPrefValue(profile()->GetPrefs(), prefs::kShowHomeButton, WaitForPrefValue(profile()->GetPrefs(), prefs::kShowHomeButton,
base::Value(true)); base::Value(true));
// Undo the signin. // Cancel sync.
ConfirmSync(LoginUIService::ABORT_SIGNIN); ConfirmSync(LoginUIService::ABORT_SYNC);
// Policy is reverted. // Policy is reverted.
WaitForPrefValue(profile()->GetPrefs(), prefs::kShowHomeButton, WaitForPrefValue(profile()->GetPrefs(), prefs::kShowHomeButton,
base::Value(false)); base::Value(false));
......
...@@ -578,7 +578,7 @@ void DiceTurnSyncOnHelper::FinishSyncSetupAndDelete( ...@@ -578,7 +578,7 @@ void DiceTurnSyncOnHelper::FinishSyncSetupAndDelete(
consent_service->SetUrlKeyedAnonymizedDataCollectionEnabled(true); consent_service->SetUrlKeyedAnonymizedDataCollectionEnabled(true);
break; break;
} }
case LoginUIService::ABORT_SIGNIN: case LoginUIService::ABORT_SYNC:
auto* primary_account_mutator = auto* primary_account_mutator =
identity_manager_->GetPrimaryAccountMutator(); identity_manager_->GetPrimaryAccountMutator();
DCHECK(primary_account_mutator); DCHECK(primary_account_mutator);
......
...@@ -460,7 +460,7 @@ class DiceTurnSyncOnHelperTest : public testing::Test { ...@@ -460,7 +460,7 @@ class DiceTurnSyncOnHelperTest : public testing::Test {
DiceTurnSyncOnHelper::SigninChoice enterprise_choice_ = DiceTurnSyncOnHelper::SigninChoice enterprise_choice_ =
DiceTurnSyncOnHelper::SIGNIN_CHOICE_CANCEL; DiceTurnSyncOnHelper::SIGNIN_CHOICE_CANCEL;
LoginUIService::SyncConfirmationUIClosedResult sync_confirmation_result_ = LoginUIService::SyncConfirmationUIClosedResult sync_confirmation_result_ =
LoginUIService::SyncConfirmationUIClosedResult::ABORT_SIGNIN; LoginUIService::SyncConfirmationUIClosedResult::ABORT_SYNC;
bool run_delegate_callbacks_ = true; bool run_delegate_callbacks_ = true;
// Expected delegate calls. // Expected delegate calls.
......
...@@ -42,8 +42,8 @@ class LoginUIService : public KeyedService { ...@@ -42,8 +42,8 @@ class LoginUIService : public KeyedService {
SYNC_WITH_DEFAULT_SETTINGS, SYNC_WITH_DEFAULT_SETTINGS,
// Show the user the sync settings before starting sync. // Show the user the sync settings before starting sync.
CONFIGURE_SYNC_FIRST, CONFIGURE_SYNC_FIRST,
// The signing process was aborted, don't start sync or show settings. // Turn sync on process was aborted, don't start sync or show settings.
ABORT_SIGNIN, ABORT_SYNC,
}; };
// Interface for obervers of LoginUIService. // Interface for obervers of LoginUIService.
......
...@@ -101,7 +101,7 @@ void SyncConfirmationHandler::HandleGoToSettings(const base::ListValue* args) { ...@@ -101,7 +101,7 @@ void SyncConfirmationHandler::HandleGoToSettings(const base::ListValue* args) {
void SyncConfirmationHandler::HandleUndo(const base::ListValue* args) { void SyncConfirmationHandler::HandleUndo(const base::ListValue* args) {
did_user_explicitly_interact_ = true; did_user_explicitly_interact_ = true;
CloseModalSigninWindow(LoginUIService::ABORT_SIGNIN); CloseModalSigninWindow(LoginUIService::ABORT_SYNC);
} }
void SyncConfirmationHandler::HandleAccountImageRequest( void SyncConfirmationHandler::HandleAccountImageRequest(
...@@ -205,7 +205,7 @@ void SyncConfirmationHandler::CloseModalSigninWindow( ...@@ -205,7 +205,7 @@ void SyncConfirmationHandler::CloseModalSigninWindow(
base::RecordAction( base::RecordAction(
base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings")); base::UserMetricsAction("Signin_Signin_WithDefaultSyncSettings"));
break; break;
case LoginUIService::ABORT_SIGNIN: case LoginUIService::ABORT_SYNC:
base::RecordAction(base::UserMetricsAction("Signin_Undo_Signin")); base::RecordAction(base::UserMetricsAction("Signin_Undo_Signin"));
break; break;
} }
......
...@@ -74,7 +74,7 @@ class SyncConfirmationHandlerTest : public BrowserWithTestWindowTest, ...@@ -74,7 +74,7 @@ class SyncConfirmationHandlerTest : public BrowserWithTestWindowTest,
SyncConfirmationHandlerTest() SyncConfirmationHandlerTest()
: did_user_explicitly_interact_(false), : did_user_explicitly_interact_(false),
on_sync_confirmation_ui_closed_called_(false), on_sync_confirmation_ui_closed_called_(false),
sync_confirmation_ui_closed_result_(LoginUIService::ABORT_SIGNIN), sync_confirmation_ui_closed_result_(LoginUIService::ABORT_SYNC),
web_ui_(new content::TestWebUI), web_ui_(new content::TestWebUI),
login_ui_service_observer_(this) {} login_ui_service_observer_(this) {}
...@@ -280,7 +280,7 @@ TEST_F(SyncConfirmationHandlerTest, TestHandleUndo) { ...@@ -280,7 +280,7 @@ TEST_F(SyncConfirmationHandlerTest, TestHandleUndo) {
did_user_explicitly_interact_ = true; did_user_explicitly_interact_ = true;
EXPECT_TRUE(on_sync_confirmation_ui_closed_called_); EXPECT_TRUE(on_sync_confirmation_ui_closed_called_);
EXPECT_EQ(LoginUIService::ABORT_SIGNIN, sync_confirmation_ui_closed_result_); EXPECT_EQ(LoginUIService::ABORT_SYNC, sync_confirmation_ui_closed_result_);
EXPECT_EQ(1, user_action_tester()->GetActionCount("Signin_Undo_Signin")); EXPECT_EQ(1, user_action_tester()->GetActionCount("Signin_Undo_Signin"));
EXPECT_EQ(0, user_action_tester()->GetActionCount( EXPECT_EQ(0, user_action_tester()->GetActionCount(
"Signin_Signin_WithDefaultSyncSettings")); "Signin_Signin_WithDefaultSyncSettings"));
......
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