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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 2177533002: Revert of BubbleFrameView: add top padding even when close button is hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « ui/views/bubble/bubble_frame_view.h ('k') | ui/views/bubble/bubble_frame_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index a3f4bf162692ea328fba73cb584177d7518de1ba..43bac842f05e438b5a8001e005c41d2ddc20ddbf 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -99,15 +99,15 @@
BubbleFrameView::~BubbleFrameView() {}
// static
-ImageButton* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
+LabelButton* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- ImageButton* close = new ImageButton(listener);
+ LabelButton* close = new LabelButton(listener, base::string16());
close->SetImage(CustomButton::STATE_NORMAL,
- rb.GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
close->SetImage(CustomButton::STATE_HOVERED,
- rb.GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
close->SetImage(CustomButton::STATE_PRESSED,
- rb.GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
close->SetBorder(nullptr);
close->SetSize(close->GetPreferredSize());
#if !defined(OS_WIN)
@@ -245,9 +245,7 @@
const int title_padding = has_title ? title_margins_.height() : 0;
const int title_height = std::max(icon_height, label_height) + title_padding;
const int close_height = close_->visible() ? close_->height() : 0;
- const int min_height = !has_title ? close_->height() : 0;
- insets +=
- gfx::Insets(std::max({title_height, close_height, min_height}), 0, 0, 0);
+ insets += gfx::Insets(std::max(title_height, close_height), 0, 0, 0);
return insets;
}
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | ui/views/bubble/bubble_frame_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698