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

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

Issue 7982009: views: Add comment to Combobox's native wrapper about its lifetime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | « views/controls/combobox/combobox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/combobox/combobox.cc
diff --git a/views/controls/combobox/combobox.cc b/views/controls/combobox/combobox.cc
index 0f8ee2bdee16e2e35578500faaaaa54071d3b460..c8bd106b6bda368f710736739c0ffc90b06ec752 100644
--- a/views/controls/combobox/combobox.cc
+++ b/views/controls/combobox/combobox.cc
@@ -126,9 +126,10 @@ void Combobox::GetAccessibleState(ui::AccessibleViewState* state) {
state->count = model()->GetItemCount();
}
-void Combobox::ViewHierarchyChanged(bool is_add, View* parent,
- View* child) {
+void Combobox::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
if (is_add && !native_wrapper_ && GetWidget()) {
+ // The native wrapper's lifetime will be managed by the view hierarchy after
+ // we call AddChildView.
native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this);
AddChildView(native_wrapper_->GetView());
}
« no previous file with comments | « views/controls/combobox/combobox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698