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

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: fix image width on win Created 6 years, 7 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
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ecfa8752d9d552a0c914314a620b97acca6962ad..bc606d1f2a4b0da1f77ebf95f2d50d09910a8012 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -1137,21 +1137,40 @@ void ProfileChooserView::CreateAccountButton(views::GridLayout* layout,
bool is_primary_account,
int width) {
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
- const gfx::ImageSkia* menu_marker =
+ const gfx::ImageSkia* default_image =
rb->GetImageNamed(IDR_CLOSE_1).ToImageSkia();
+ int kDeleteButtonWidth = default_image->width();
+ int available_width = width -
+ kDeleteButtonWidth - views::kButtonHEdgeMarginNew;
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,
+ default_image);
+ 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(
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698