summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-21 14:33:42 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-21 14:33:42 +0000
commit4ae7bbc22f33fa06e12d20ca1ebdef2a1cd3b12c (patch)
treec761e060ea0e1634fc1ab4bcbb38ee846dd8a4d8 /views/controls
parent295832dd368a2b2961a8a259d38e35e9a4063275 (diff)
downloadchromium_src-4ae7bbc22f33fa06e12d20ca1ebdef2a1cd3b12c.zip
chromium_src-4ae7bbc22f33fa06e12d20ca1ebdef2a1cd3b12c.tar.gz
chromium_src-4ae7bbc22f33fa06e12d20ca1ebdef2a1cd3b12c.tar.bz2
views: Add comment to Combobox's native wrapper about its lifetime.
R=sky@chromium.org Review URL: http://codereview.chromium.org/7982009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/combobox/combobox.cc5
-rw-r--r--views/controls/combobox/combobox.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/views/controls/combobox/combobox.cc b/views/controls/combobox/combobox.cc
index 0f8ee2b..c8bd106 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());
}
diff --git a/views/controls/combobox/combobox.h b/views/controls/combobox/combobox.h
index 1971f7f..a582688 100644
--- a/views/controls/combobox/combobox.h
+++ b/views/controls/combobox/combobox.h
@@ -82,7 +82,8 @@ class VIEWS_EXPORT Combobox : public View {
protected:
// Overridden from View:
- virtual void ViewHierarchyChanged(bool is_add, View* parent,
+ virtual void ViewHierarchyChanged(bool is_add,
+ View* parent,
View* child) OVERRIDE;
virtual std::string GetClassName() const OVERRIDE;