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

Unified Diff: ui/views/controls/combobox/combobox.cc

Issue 104573003: Make ComboboxListener work around being deleted from OnSelectedIndexChanged(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sky@ review Created 7 years 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 | « no previous file | ui/views/controls/combobox/combobox_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox.cc
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index d726fe2032f5528c0a56925f9378ff27d2de58a9..264e3560b80cd986f3db96f125fe98e1b718c59e 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -468,10 +468,11 @@ void Combobox::ShowDropDownMenu(ui::MenuSourceType source_type) {
}
void Combobox::OnSelectionChanged() {
- if (listener_)
- listener_->OnSelectedIndexChanged(this);
NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_VALUE_CHANGED, false);
SchedulePaint();
+ if (listener_)
+ listener_->OnSelectedIndexChanged(this);
+ // |this| may now be deleted.
}
int Combobox::MenuCommandToIndex(int menu_command_id) const {
« no previous file with comments | « no previous file | ui/views/controls/combobox/combobox_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698