Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4620)

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..628c39718e1ec8cfa975d7ba008c38afe45bbfea 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_);
@@ -1560,8 +1558,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 +1631,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 +1776,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 +2007,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_);
}

Powered by Google App Engine
This is Rietveld 408576698