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

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

Issue 1216673005: views::LabelButton should not call virtual methods from its constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150703-Views-ButtonBorderRefactor
Patch Set: selfnits Created 5 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
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 4f8f4a1667b1e73ef85dbba1d40ffd27d88d178d..6d2e1849d356f8d76fe61dd7fdd6194840e97c31 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -97,14 +97,15 @@ gfx::Insets BubbleFrameView::GetTitleInsets() {
// static
LabelButton* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- LabelButton* close = new LabelButton(listener, base::string16());
+ LabelButton* close = new LabelButton(listener);
+ close->SetBorder(nullptr);
+ close->Init(base::string16());
close->SetImage(CustomButton::STATE_NORMAL,
*rb.GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
close->SetImage(CustomButton::STATE_HOVERED,
*rb.GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
close->SetImage(CustomButton::STATE_PRESSED,
*rb.GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
- close->SetBorder(nullptr);
sadrul 2015/07/08 05:59:11 What happens if this call to SetBorder() happens a
tapted 2015/07/08 06:31:32 That still works fine - it just wastes work becaus
close->SetSize(close->GetPreferredSize());
#if !defined(OS_WIN)
// Windows will automatically create a tooltip for the close button based on

Powered by Google App Engine
This is Rietveld 408576698