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

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

Issue 265073003: [Win, Mac] UI fixes for the delete account button in the new avatar bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months 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 f580b8763fb4aedac95d7b4c162b2481f6458932..f39b26f1cf1f910da85b5f66a1a2b4e1c3bbad13 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -1084,22 +1084,39 @@ void ProfileChooserView::CreateAccountButton(views::GridLayout* layout,
const std::string& account,
bool is_primary_account,
int width) {
- ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
- const gfx::ImageSkia* menu_marker =
- rb->GetImageNamed(IDR_CLOSE_1).ToImageSkia();
+ const int kDeleteButtonWidth = 18;
+ int available_width = width -
+ kDeleteButtonWidth - views::kButtonHEdgeMarginNew;
+ ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
views::LabelButton* email_button = new BackgroundColorHoverButton(
- this,
+ NULL,
gfx::ElideEmail(base::UTF8ToUTF16(account),
rb->GetFontList(ui::ResourceBundle::BaseFont),
- width - menu_marker->width()),
+ available_width),
gfx::ImageSkia(),
gfx::ImageSkia());
layout->StartRow(1, 0);
layout->AddView(email_button);
+ // Delete button.
+ views::ImageButton* delete_button = new views::ImageButton(this);
+ delete_button->SetImageAlignment(views::ImageButton::ALIGN_RIGHT,
+ views::ImageButton::ALIGN_MIDDLE);
+ delete_button->SetImage(views::ImageButton::STATE_NORMAL,
+ rb->GetImageSkiaNamed(IDR_CLOSE_1));
+ delete_button->SetImage(views::ImageButton::STATE_HOVERED,
+ rb->GetImageSkiaNamed(IDR_CLOSE_1_H));
+ delete_button->SetImage(views::ImageButton::STATE_PRESSED,
+ rb->GetImageSkiaNamed(IDR_CLOSE_1_P));
+ delete_button->SetBounds(
+ available_width, 0, kDeleteButtonWidth, kButtonHeight);
+
+ email_button->set_notify_enter_exit_on_child(true);
+ email_button->AddChildView(delete_button);
+
// Save the original email address, as the button text could be elided.
- current_profile_accounts_map_[email_button] = account;
+ current_profile_accounts_map_[delete_button] = account;
}
views::View* ProfileChooserView::CreateGaiaSigninView(

Powered by Google App Engine
This is Rietveld 408576698