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

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

Issue 7981019: views: Get rid of TabbedPane::CreateWrapper(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add lifetime comment 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/tabbed_pane/tabbed_pane.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/tabbed_pane/tabbed_pane.cc
diff --git a/views/controls/tabbed_pane/tabbed_pane.cc b/views/controls/tabbed_pane/tabbed_pane.cc
index 28920f431458710a50b73df943060771e6595d37..3dec215c0ca6952e34639d5da89c6ab4158f0759 100644
--- a/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/views/controls/tabbed_pane/tabbed_pane.cc
@@ -71,10 +71,6 @@ gfx::Size TabbedPane::GetPreferredSize() {
native_tabbed_pane_->GetPreferredSize() : gfx::Size();
}
-void TabbedPane::CreateWrapper() {
- native_tabbed_pane_ = NativeTabbedPaneWrapper::CreateNativeWrapper(this);
-}
-
void TabbedPane::LoadAccelerators() {
// Ctrl+Shift+Tab
AddAccelerator(views::Accelerator(ui::VKEY_TAB, true, true, false));
@@ -89,7 +85,9 @@ void TabbedPane::Layout() {
void TabbedPane::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
if (is_add && !native_tabbed_pane_) {
- CreateWrapper();
+ // The native wrapper's lifetime will be managed by the view hierarchy after
+ // we call AddChildView.
+ native_tabbed_pane_ = NativeTabbedPaneWrapper::CreateNativeWrapper(this);
AddChildView(native_tabbed_pane_->GetView());
LoadAccelerators();
}
« no previous file with comments | « views/controls/tabbed_pane/tabbed_pane.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698