| Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
|
| diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
|
| index c120740e4149a7765fb2e2cf9eb3a5aed2f9989e..4788063ad3ab5f3f7b7c3818ec8b225d946cdf49 100644
|
| --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
|
| +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
|
| @@ -195,8 +195,7 @@ class BackgroundColorHoverButton : public views::LabelButton {
|
| const int button_margin = switches::IsMaterialDesignUserMenu()
|
| ? kMaterialMenuEdgeMargin
|
| : views::kButtonHEdgeMarginNew;
|
| - SetBorder(
|
| - views::Border::CreateEmptyBorder(0, button_margin, 0, button_margin));
|
| + SetBorder(views::CreateEmptyBorder(0, button_margin, 0, button_margin));
|
| SetFocusForPlatform();
|
| set_request_focus_on_press(true);
|
|
|
| @@ -363,7 +362,7 @@ class EditableProfilePhoto : public views::LabelButton {
|
| gfx::Image image = profiles::GetSizedAvatarIcon(
|
| icon, true, icon_image_side(), icon_image_side());
|
| SetImage(views::LabelButton::STATE_NORMAL, *image.ToImageSkia());
|
| - SetBorder(views::Border::NullBorder());
|
| + SetBorder(views::NullBorder());
|
| if (switches::IsMaterialDesignUserMenu()) {
|
| SetMinSize(gfx::Size(GetPreferredSize().width() + badge_spacing(),
|
| GetPreferredSize().height() + badge_spacing() +
|
| @@ -528,8 +527,7 @@ class EditableProfileName : public views::View,
|
|
|
| if (!is_editing_allowed) {
|
| views::Label* name_label = new views::Label(text);
|
| - name_label->SetBorder(
|
| - views::Border::CreateEmptyBorder(textfield_border_insets));
|
| + name_label->SetBorder(views::CreateEmptyBorder(textfield_border_insets));
|
| name_label->SetFontList(medium_font_list);
|
| AddChildView(name_label);
|
| return;
|
| @@ -563,7 +561,7 @@ class EditableProfileName : public views::View,
|
| // We need to add a left padding as well as a small top/bottom padding
|
| // to the text to account for the textfield's border.
|
| const int kIconTextLabelButtonSpacing = 5;
|
| - button_->SetBorder(views::Border::CreateEmptyBorder(
|
| + button_->SetBorder(views::CreateEmptyBorder(
|
| textfield_border_insets +
|
| gfx::Insets(0, kIconSize + kIconTextLabelButtonSpacing, 0, 0)));
|
| AddChildView(button_);
|
| @@ -698,14 +696,18 @@ void ProfileChooserView::ShowBubble(
|
| signin_metrics::AccessPoint access_point,
|
| views::View* anchor_view,
|
| 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.
|
| // It has to happen here to prevent the view system from creating an empty
|
| // 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 &&
|
| - (!profiles::HasProfileSwitchTargets(browser->profile()) ||
|
| - switches::IsMaterialDesignUserMenu())) {
|
| + !profiles::HasProfileSwitchTargets(browser->profile())) {
|
| return;
|
| }
|
|
|
| @@ -1560,8 +1562,8 @@ views::View* ProfileChooserView::CreateSyncErrorViewIfNeeded() {
|
| *button_out = views::MdTextButton::CreateSecondaryUiBlueButton(
|
| this, l10n_util::GetStringUTF16(button_string_id));
|
| vertical_view->AddChildView(*button_out);
|
| - view->SetBorder(views::Border::CreateEmptyBorder(
|
| - 0, 0, views::kRelatedControlSmallVerticalSpacing, 0));
|
| + view->SetBorder(views::CreateEmptyBorder(
|
| + 0, 0, views::kRelatedControlSmallVerticalSpacing, 0));
|
| }
|
|
|
| view->AddChildView(vertical_view);
|
| @@ -1633,7 +1635,7 @@ views::View* ProfileChooserView::CreateCurrentProfileView(
|
| gfx::Insets insets =
|
| views::LabelButtonAssetBorder::GetDefaultInsetsForStyle(
|
| views::Button::STYLE_TEXTBUTTON);
|
| - auth_error_email_button_->SetBorder(views::Border::CreateEmptyBorder(
|
| + auth_error_email_button_->SetBorder(views::CreateEmptyBorder(
|
| insets.top(), insets.left(), insets.bottom(), insets.right()));
|
| layout->AddView(auth_error_email_button_);
|
| } else {
|
| @@ -1778,7 +1780,7 @@ views::View* ProfileChooserView::CreateMaterialDesignCurrentProfileView(
|
| extra_links_view->AddChildView(signin_current_profile_button_);
|
| content::RecordAction(
|
| base::UserMetricsAction("Signin_Impression_FromAvatarBubbleSignin"));
|
| - extra_links_view->SetBorder(views::Border::CreateEmptyBorder(
|
| + extra_links_view->SetBorder(views::CreateEmptyBorder(
|
| 0, 0, views::kRelatedControlSmallVerticalSpacing, 0));
|
| view->AddChildView(extra_links_view);
|
| }
|
| @@ -2009,9 +2011,9 @@ views::View* ProfileChooserView::CreateCurrentProfileAccountsView(
|
|
|
| add_account_link_ = CreateLink(l10n_util::GetStringFUTF16(
|
| IDS_PROFILES_PROFILE_ADD_ACCOUNT_BUTTON, avatar_item.name), this);
|
| - add_account_link_->SetBorder(views::Border::CreateEmptyBorder(
|
| - 0, views::kButtonVEdgeMarginNew,
|
| - views::kRelatedControlVerticalSpacing, 0));
|
| + add_account_link_->SetBorder(
|
| + views::CreateEmptyBorder(0, views::kButtonVEdgeMarginNew,
|
| + views::kRelatedControlVerticalSpacing, 0));
|
| layout->StartRow(1, 0);
|
| layout->AddView(add_account_link_);
|
| }
|
|
|