Commit 92487965 authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Remove access point in ProfileMenuView constructor

The correct access point is always ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN.

Fixed: 1041469
Change-Id: Ia698fec6da8a221f36188a87f899a0bbd4a10d4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2000639
Auto-Submit: David Roger <droger@chromium.org>
Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732397}
parent ae012e64
......@@ -3096,8 +3096,8 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton(
return;
}
#endif
ProfileMenuViewBase::ShowBubble(bubble_view_mode, access_point, avatar_button,
browser(), focus_first_profile_button);
ProfileMenuViewBase::ShowBubble(bubble_view_mode, avatar_button, browser(),
focus_first_profile_button);
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
}
......
......@@ -122,10 +122,8 @@ bool IsSyncPaused(Profile* profile) {
// static
bool ProfileMenuView::close_on_deactivate_for_testing_ = true;
ProfileMenuView::ProfileMenuView(views::Button* anchor_button,
Browser* browser,
signin_metrics::AccessPoint access_point)
: ProfileMenuViewBase(anchor_button, browser), access_point_(access_point) {
ProfileMenuView::ProfileMenuView(views::Button* anchor_button, Browser* browser)
: ProfileMenuViewBase(anchor_button, browser) {
GetViewAccessibility().OverrideName(GetAccessibleWindowTitle());
chrome::RecordDialogCreation(chrome::DialogIdentifier::PROFILE_CHOOSER);
set_close_on_deactivate(close_on_deactivate_for_testing_);
......@@ -251,13 +249,15 @@ void ProfileMenuView::OnSyncErrorButtonClicked(
signin_metrics::SignoutDelete::IGNORE_METRIC);
Hide();
browser()->signin_view_controller()->ShowSignin(
profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, browser(), access_point_);
profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, browser(),
signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN);
}
break;
case sync_ui_util::AUTH_ERROR:
Hide();
browser()->signin_view_controller()->ShowSignin(
profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH, browser(), access_point_);
profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH, browser(),
signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN);
break;
case sync_ui_util::UPGRADE_CLIENT_ERROR:
chrome::OpenUpdateChromeDialog(browser());
......@@ -280,14 +280,17 @@ void ProfileMenuView::OnSigninButtonClicked() {
RecordClick(ActionableItem::kSigninButton);
Hide();
browser()->signin_view_controller()->ShowSignin(
profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, browser(), access_point_);
profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, browser(),
signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN);
}
void ProfileMenuView::OnSigninAccountButtonClicked(AccountInfo account) {
RecordClick(ActionableItem::kSigninAccountButton);
Hide();
signin_ui_util::EnableSyncFromPromo(browser(), account, access_point_,
true /* is_default_promo_account */);
signin_ui_util::EnableSyncFromPromo(
browser(), account,
signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN,
true /* is_default_promo_account */);
}
void ProfileMenuView::OnSignoutButtonClicked() {
......
......@@ -31,9 +31,7 @@ class Browser;
// It displays a list of profiles and allows users to switch between profiles.
class ProfileMenuView : public ProfileMenuViewBase {
public:
ProfileMenuView(views::Button* anchor_button,
Browser* browser,
signin_metrics::AccessPoint access_point);
ProfileMenuView(views::Button* anchor_button, Browser* browser);
~ProfileMenuView() override;
// ProfileMenuViewBase:
......@@ -82,9 +80,6 @@ class ProfileMenuView : public ProfileMenuViewBase {
// Clean-up done after an action was performed in the ProfileChooser.
void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed);
// The current access point of sign in.
const signin_metrics::AccessPoint access_point_;
DISALLOW_COPY_AND_ASSIGN(ProfileMenuView);
};
......
......@@ -166,7 +166,6 @@ std::unique_ptr<views::Button> CreateCircularImageButton(
// static
void ProfileMenuViewBase::ShowBubble(
profiles::BubbleViewMode view_mode,
signin_metrics::AccessPoint access_point,
views::Button* anchor_button,
Browser* browser,
bool is_source_keyboard) {
......@@ -183,7 +182,7 @@ void ProfileMenuViewBase::ShowBubble(
} else {
DCHECK_EQ(profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, view_mode);
#if !defined(OS_CHROMEOS)
bubble = new ProfileMenuView(anchor_button, browser, access_point);
bubble = new ProfileMenuView(anchor_button, browser);
#else
NOTREACHED();
return;
......
......@@ -69,7 +69,6 @@ class ProfileMenuViewBase : public content::WebContentsDelegate,
// the existing bubble will auto-close due to focus loss.
static void ShowBubble(
profiles::BubbleViewMode view_mode,
signin_metrics::AccessPoint access_point,
views::Button* anchor_button,
Browser* browser,
bool is_source_keyboard);
......
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