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

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: self review 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
« no previous file with comments | « ui/views/accessible_pane_view_unittest.cc ('k') | ui/views/button_drag_utils.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 4f8f4a1667b1e73ef85dbba1d40ffd27d88d178d..7761fc351f85416b542d162fcb57a2842e273b5f 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->InitAsTextbutton(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);
close->SetSize(close->GetPreferredSize());
#if !defined(OS_WIN)
// Windows will automatically create a tooltip for the close button based on
« no previous file with comments | « ui/views/accessible_pane_view_unittest.cc ('k') | ui/views/button_drag_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698