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( ...@@ -3096,8 +3096,8 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton(
return; return;
} }
#endif #endif
ProfileMenuViewBase::ShowBubble(bubble_view_mode, access_point, avatar_button, ProfileMenuViewBase::ShowBubble(bubble_view_mode, avatar_button, browser(),
browser(), focus_first_profile_button); focus_first_profile_button);
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
} }
......
...@@ -122,10 +122,8 @@ bool IsSyncPaused(Profile* profile) { ...@@ -122,10 +122,8 @@ bool IsSyncPaused(Profile* profile) {
// static // static
bool ProfileMenuView::close_on_deactivate_for_testing_ = true; bool ProfileMenuView::close_on_deactivate_for_testing_ = true;
ProfileMenuView::ProfileMenuView(views::Button* anchor_button, ProfileMenuView::ProfileMenuView(views::Button* anchor_button, Browser* browser)
Browser* browser, : ProfileMenuViewBase(anchor_button, browser) {
signin_metrics::AccessPoint access_point)
: ProfileMenuViewBase(anchor_button, browser), access_point_(access_point) {
GetViewAccessibility().OverrideName(GetAccessibleWindowTitle()); GetViewAccessibility().OverrideName(GetAccessibleWindowTitle());
chrome::RecordDialogCreation(chrome::DialogIdentifier::PROFILE_CHOOSER); chrome::RecordDialogCreation(chrome::DialogIdentifier::PROFILE_CHOOSER);
set_close_on_deactivate(close_on_deactivate_for_testing_); set_close_on_deactivate(close_on_deactivate_for_testing_);
...@@ -251,13 +249,15 @@ void ProfileMenuView::OnSyncErrorButtonClicked( ...@@ -251,13 +249,15 @@ void ProfileMenuView::OnSyncErrorButtonClicked(
signin_metrics::SignoutDelete::IGNORE_METRIC); signin_metrics::SignoutDelete::IGNORE_METRIC);
Hide(); Hide();
browser()->signin_view_controller()->ShowSignin( 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; break;
case sync_ui_util::AUTH_ERROR: case sync_ui_util::AUTH_ERROR:
Hide(); Hide();
browser()->signin_view_controller()->ShowSignin( 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; break;
case sync_ui_util::UPGRADE_CLIENT_ERROR: case sync_ui_util::UPGRADE_CLIENT_ERROR:
chrome::OpenUpdateChromeDialog(browser()); chrome::OpenUpdateChromeDialog(browser());
...@@ -280,13 +280,16 @@ void ProfileMenuView::OnSigninButtonClicked() { ...@@ -280,13 +280,16 @@ void ProfileMenuView::OnSigninButtonClicked() {
RecordClick(ActionableItem::kSigninButton); RecordClick(ActionableItem::kSigninButton);
Hide(); Hide();
browser()->signin_view_controller()->ShowSignin( 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) { void ProfileMenuView::OnSigninAccountButtonClicked(AccountInfo account) {
RecordClick(ActionableItem::kSigninAccountButton); RecordClick(ActionableItem::kSigninAccountButton);
Hide(); Hide();
signin_ui_util::EnableSyncFromPromo(browser(), account, access_point_, signin_ui_util::EnableSyncFromPromo(
browser(), account,
signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN,
true /* is_default_promo_account */); true /* is_default_promo_account */);
} }
......
...@@ -31,9 +31,7 @@ class Browser; ...@@ -31,9 +31,7 @@ class Browser;
// It displays a list of profiles and allows users to switch between profiles. // It displays a list of profiles and allows users to switch between profiles.
class ProfileMenuView : public ProfileMenuViewBase { class ProfileMenuView : public ProfileMenuViewBase {
public: public:
ProfileMenuView(views::Button* anchor_button, ProfileMenuView(views::Button* anchor_button, Browser* browser);
Browser* browser,
signin_metrics::AccessPoint access_point);
~ProfileMenuView() override; ~ProfileMenuView() override;
// ProfileMenuViewBase: // ProfileMenuViewBase:
...@@ -82,9 +80,6 @@ class ProfileMenuView : public ProfileMenuViewBase { ...@@ -82,9 +80,6 @@ class ProfileMenuView : public ProfileMenuViewBase {
// Clean-up done after an action was performed in the ProfileChooser. // Clean-up done after an action was performed in the ProfileChooser.
void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed); void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed);
// The current access point of sign in.
const signin_metrics::AccessPoint access_point_;
DISALLOW_COPY_AND_ASSIGN(ProfileMenuView); DISALLOW_COPY_AND_ASSIGN(ProfileMenuView);
}; };
......
...@@ -166,7 +166,6 @@ std::unique_ptr<views::Button> CreateCircularImageButton( ...@@ -166,7 +166,6 @@ std::unique_ptr<views::Button> CreateCircularImageButton(
// static // static
void ProfileMenuViewBase::ShowBubble( void ProfileMenuViewBase::ShowBubble(
profiles::BubbleViewMode view_mode, profiles::BubbleViewMode view_mode,
signin_metrics::AccessPoint access_point,
views::Button* anchor_button, views::Button* anchor_button,
Browser* browser, Browser* browser,
bool is_source_keyboard) { bool is_source_keyboard) {
...@@ -183,7 +182,7 @@ void ProfileMenuViewBase::ShowBubble( ...@@ -183,7 +182,7 @@ void ProfileMenuViewBase::ShowBubble(
} else { } else {
DCHECK_EQ(profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, view_mode); DCHECK_EQ(profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, view_mode);
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
bubble = new ProfileMenuView(anchor_button, browser, access_point); bubble = new ProfileMenuView(anchor_button, browser);
#else #else
NOTREACHED(); NOTREACHED();
return; return;
......
...@@ -69,7 +69,6 @@ class ProfileMenuViewBase : public content::WebContentsDelegate, ...@@ -69,7 +69,6 @@ class ProfileMenuViewBase : public content::WebContentsDelegate,
// the existing bubble will auto-close due to focus loss. // the existing bubble will auto-close due to focus loss.
static void ShowBubble( static void ShowBubble(
profiles::BubbleViewMode view_mode, profiles::BubbleViewMode view_mode,
signin_metrics::AccessPoint access_point,
views::Button* anchor_button, views::Button* anchor_button,
Browser* browser, Browser* browser,
bool is_source_keyboard); 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