Commit b523a338 authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

Record "move password to account" bubble offered to non opted-in user

The CL calls the incrementer from crrev.com/c/2340966 (later renamed).
Now, a per-Gaia-account counter is incremented whenever the move bubble
is shown and the user is not opted-in to the account-scoped passwords
storage. The bubble won't be shown for users whose count is above a
certain threshold (see crrev.com/c/2345309).

Bug: 1082152
Change-Id: Id0ef7fd6b85598a1cb0651435a5c6f9bf6214049
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351995Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#797268}
parent 2ca88ece
......@@ -289,6 +289,8 @@ void ManagePasswordsUIController::OnShowMoveToAccountBubble(
"PasswordManager.AccountStorage.MoveToAccountStoreFlowOffered",
password_manager::metrics_util::MoveToAccountStoreTrigger::
kSuccessfulLoginWithProfileStorePassword);
if (!GetPasswordFeatureManager()->IsOptedInForAccountStorage())
GetPasswordFeatureManager()->RecordMoveOfferedToNonOptedInUser();
passwords_data_.OnPasswordMovable(std::move(form_to_move));
// TODO(crbug.com/1100814): Add smartness like OnPasswordSubmitted?
bubble_status_ = BubbleStatus::SHOULD_POP_UP;
......
......@@ -1636,6 +1636,8 @@ TEST_F(ManagePasswordsUIControllerTest, ReauthenticateBeforeMove) {
// A submitted form triggers the move dialog.
EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility())
.Times(AtLeast(1));
EXPECT_CALL(*client().GetPasswordFeatureManager(),
RecordMoveOfferedToNonOptedInUser);
controller()->OnShowMoveToAccountBubble(std::move(test_form_manager));
EXPECT_TRUE(controller()->opened_automatic_bubble());
ExpectIconAndControllerStateIs(
......@@ -1662,6 +1664,8 @@ TEST_F(ManagePasswordsUIControllerTest, ReauthenticateFailsBeforeMove) {
// A submitted form triggers the move dialog.
EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility());
EXPECT_CALL(*client().GetPasswordFeatureManager(),
RecordMoveOfferedToNonOptedInUser);
controller()->OnShowMoveToAccountBubble(std::move(test_form_manager));
EXPECT_TRUE(controller()->opened_automatic_bubble());
ExpectIconAndControllerStateIs(
......
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