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

Unified Diff: ui/views/controls/button/menu_button.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/controls/button/menu_button.cc
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
index 614fd5e9b0eef5ee7df3a91ffa91a177ad08cc2d..638cb3e45f9da50de03df8efd65af089e28e3eaf 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -65,7 +65,7 @@ MenuButton::MenuButton(ButtonListener* listener,
const base::string16& text,
MenuButtonListener* menu_button_listener,
bool show_menu_marker)
- : LabelButton(listener, text),
+ : LabelButton(listener),
menu_offset_(kDefaultMenuOffsetX, kDefaultMenuOffsetY),
listener_(menu_button_listener),
show_menu_marker_(show_menu_marker),
@@ -76,6 +76,10 @@ MenuButton::MenuButton(ButtonListener* listener,
should_disable_after_press_(false),
weak_factory_(this) {
SetHorizontalAlignment(gfx::ALIGN_LEFT);
+
+ // TODO(tapted): Remove this. MenuButton has subclasses and Init() may call
+ // virtual methods.
+ Init(text);
}
MenuButton::~MenuButton() {

Powered by Google App Engine
This is Rietveld 408576698