diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 17:43:05 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 17:43:05 +0000 |
commit | af1fde05ba3696986ba28445ea0c74f96d456ebb (patch) | |
tree | 8986d27bfec650d279fa085767279a59442c6eaf /views/controls/tabbed_pane | |
parent | a6ea9c6010cfa383356c3e84c2976132ce22c9d1 (diff) | |
download | chromium_src-af1fde05ba3696986ba28445ea0c74f96d456ebb.zip chromium_src-af1fde05ba3696986ba28445ea0c74f96d456ebb.tar.gz chromium_src-af1fde05ba3696986ba28445ea0c74f96d456ebb.tar.bz2 |
Rework the way Widget::Init works:
- Remove SetCreateParams from the public Widget API.
- Add parent/bounds fields to CreateParams
- Make Widget::Init be the canonical init method (vs. WidgetWin/Gtk Init) and have it take a CreateParams.
- NativeWidget now has a InitNativeWidget method, which subclasses can override. Everyone must call Widget::Init via Widget* (not WidgetWin* as this will be ambiguous to WindowImpl::Init).
BUG=72040
TEST=none
Review URL: http://codereview.chromium.org/6881107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/tabbed_pane')
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_gtk.cc | 4 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_win.cc | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc index df935db..d2286b3 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc @@ -154,9 +154,9 @@ void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, int tab_count = GetTabCount(); DCHECK(index <= tab_count); - Widget* page_container = Widget::CreateWidget( + Widget* page_container = Widget::CreateWidget(); + page_container->Init( Widget::CreateParams(Widget::CreateParams::TYPE_CONTROL)); - page_container->Init(NULL, gfx::Rect()); page_container->SetContentsView(contents); page_container->SetFocusTraversableParent(GetWidget()->GetFocusTraversable()); page_container->SetFocusTraversableParentView(this); diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index 91e053f..3d897f6 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -291,9 +291,10 @@ void NativeTabbedPaneWin::CreateNativeControl() { SendMessage(tab_control, WM_SETFONT, reinterpret_cast<WPARAM>(font), FALSE); // Create the view container which is a child of the TabControl. - content_window_ = Widget::CreateWidget( - Widget::CreateParams(Widget::CreateParams::TYPE_CONTROL)); - content_window_->Init(tab_control, gfx::Rect()); + content_window_ = Widget::CreateWidget(); + Widget::CreateParams params(Widget::CreateParams::TYPE_CONTROL); + params.parent = tab_control; + content_window_->Init(params); // Explicitly setting the WS_EX_LAYOUTRTL property for the HWND (see above // for why we waited until |content_window_| is created before we set this |