Chromium Code Reviews| Index: chrome/browser/ui/views/profiles/new_avatar_button.cc |
| diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc |
| index ec28c46d12f6bfd6ecc1366fa9ca58afb44a29c7..daadb6b1334dd5d56be732c27fbfd14598c988b4 100644 |
| --- a/chrome/browser/ui/views/profiles/new_avatar_button.cc |
| +++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc |
| @@ -26,14 +26,16 @@ namespace { |
| // Text padding within the button border. |
| const int kInset = 10; |
| +const int kBottomInset = 3; |
|
msw
2014/05/28 19:34:58
I'm not sure this change does the right thing. In
noms (inactive)
2014/05/28 19:59:27
The misalignment of the drop-down arrow and the sh
noms (inactive)
2014/05/30 17:43:34
Actually, I'd rather fix them in a separate CL. Th
|
| scoped_ptr<views::Border> CreateBorder(const int normal_image_set[], |
| const int hot_image_set[], |
| - const int pushed_image_set[]) { |
| + const int pushed_image_set[], |
| + bool is_themed_window) { |
| scoped_ptr<views::TextButtonDefaultBorder> border( |
| new views::TextButtonDefaultBorder()); |
| - |
| - border->SetInsets(gfx::Insets(kInset, kInset, kInset, kInset)); |
| + int bottom_inset = is_themed_window ? kBottomInset : 0; |
| + border->SetInsets(gfx::Insets(0, kInset, bottom_inset, kInset)); |
| border->set_normal_painter( |
| views::Painter::CreateImageGridPainter(normal_image_set)); |
| border->set_hot_painter( |
| @@ -80,7 +82,8 @@ NewAvatarButton::NewAvatarButton( |
| const int kHotImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_HOVER); |
| const int kPushedImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_PRESSED); |
| - SetBorder(CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet)); |
| + SetBorder( |
| + CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet, true)); |
| set_menu_marker( |
| rb->GetImageNamed(IDR_AVATAR_THEMED_BUTTON_DROPARROW).ToImageSkia()); |
| } else if (is_win8) { |
| @@ -88,7 +91,8 @@ NewAvatarButton::NewAvatarButton( |
| const int kHotImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_HOVER); |
| const int kPushedImageSet[] = IMAGE_GRID(IDR_AVATAR_METRO_BUTTON_PRESSED); |
| - SetBorder(CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet)); |
| + SetBorder( |
| + CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet, false)); |
| set_menu_marker( |
| rb->GetImageNamed(IDR_AVATAR_METRO_BUTTON_DROPARROW).ToImageSkia()); |
| } else { |
| @@ -96,7 +100,8 @@ NewAvatarButton::NewAvatarButton( |
| const int kHotImageSet[] = IMAGE_GRID(IDR_AVATAR_GLASS_BUTTON_HOVER); |
| const int kPushedImageSet[] = IMAGE_GRID(IDR_AVATAR_GLASS_BUTTON_PRESSED); |
| - SetBorder(CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet)); |
| + SetBorder( |
| + CreateBorder(kNormalImageSet, kHotImageSet, kPushedImageSet, false)); |
| set_menu_marker( |
| rb->GetImageNamed(IDR_AVATAR_GLASS_BUTTON_DROPARROW).ToImageSkia()); |
| } |
| @@ -126,7 +131,7 @@ NewAvatarButton::~NewAvatarButton() { |
| void NewAvatarButton::OnPaintText(gfx::Canvas* canvas, PaintButtonMode mode) { |
| // Get text bounds, and then adjust for the top and RTL languages. |
| gfx::Rect rect = GetTextBounds(); |
| - rect.Offset(0, -rect.y()); |
| + |
| if (rect.width() > 0) |
| rect.set_x(GetMirroredXForRect(rect)); |
| @@ -164,7 +169,8 @@ void NewAvatarButton::OnErrorChanged() { |
| signin_error_controller(); |
| if (error->HasError()) { |
| ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| - icon = *rb->GetImageNamed(IDR_WARNING).ToImageSkia(); |
| + icon = *rb->GetImageNamed( |
| + IDR_ICON_PROFILES_AVATAR_BUTTON_ERROR).ToImageSkia(); |
|
msw
2014/05/28 19:34:58
nit: We have many similar warning icons:
update_fa
noms (inactive)
2014/05/28 19:59:27
Oh my. So I was just given the new avatar_button_a
msw
2014/05/28 20:56:27
If scaling down the larger icon looks okay (and is
noms (inactive)
2014/05/30 17:43:34
Done.
|
| } |
| SetIcon(icon); |