Commit cee1ec7c authored by msarda's avatar msarda Committed by Commit bot

Revert "Show user menu on right-click of the avatar button when MaterialDesignUserMenu is enabled."

This reverts commit 6b24b79e.

The reason for this revert is that we want to remove the right-click
behavior from new user menu.

BUG=661289

Review-Url: https://codereview.chromium.org/2617493002
Cr-Commit-Position: refs/heads/master@{#441403}
parent 9b65fe51
...@@ -1568,8 +1568,8 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, ...@@ -1568,8 +1568,8 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
[[NSMutableArray alloc] init]); [[NSMutableArray alloc] init]);
// Local and guest profiles cannot lock their profile. // Local and guest profiles cannot lock their profile.
bool showLock = false; bool showLock = false;
bool isFastProfileChooser = switches::IsMaterialDesignUserMenu() ? bool isFastProfileChooser =
false : viewMode_ == profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER; viewMode_ == profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER;
if (isFastProfileChooser) { if (isFastProfileChooser) {
// The user is using right-click switching, no need to tell them about it. // The user is using right-click switching, no need to tell them about it.
PrefService* localState = g_browser_process->local_state(); PrefService* localState = g_browser_process->local_state();
...@@ -1606,9 +1606,11 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, ...@@ -1606,9 +1606,11 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
CGFloat yOffset = 1; CGFloat yOffset = 1;
if (isFastProfileChooser) { if (isFastProfileChooser) {
[self buildFastUserSwitcherViewWithProfiles:otherProfiles.get() if (!switches::IsMaterialDesignUserMenu()) {
atYOffset:yOffset [self buildFastUserSwitcherViewWithProfiles:otherProfiles.get()
inContainer:container]; atYOffset:yOffset
inContainer:container];
}
} else { } else {
[self buildProfileChooserViewWithProfileView:currentProfileView [self buildProfileChooserViewWithProfileView:currentProfileView
tutorialView:tutorialView tutorialView:tutorialView
......
...@@ -686,18 +686,14 @@ void ProfileChooserView::ShowBubble( ...@@ -686,18 +686,14 @@ void ProfileChooserView::ShowBubble(
signin_metrics::AccessPoint access_point, signin_metrics::AccessPoint access_point,
views::View* anchor_view, views::View* anchor_view,
Browser* browser) { Browser* browser) {
if (switches::IsMaterialDesignUserMenu()) {
// The Material Design User Menu doesn't have a fast user switcher on
// right-click. To ease up the transition for users, show the regular user
// menu when right-clicking instead of doing nothing.
view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
}
// Don't start creating the view if it would be an empty fast user switcher. // Don't start creating the view if it would be an empty fast user switcher.
// It has to happen here to prevent the view system from creating an empty // It has to happen here to prevent the view system from creating an empty
// container. // container.
// Same for material design user menu since fast profile switcher will be
// migrated to the left-click menu.
if (view_mode == profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER && if (view_mode == profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER &&
!profiles::HasProfileSwitchTargets(browser->profile())) { (!profiles::HasProfileSwitchTargets(browser->profile()) ||
switches::IsMaterialDesignUserMenu())) {
return; return;
} }
......
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