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/widget/widget.cc | |
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/widget/widget.cc')
-rw-r--r-- | views/widget/widget.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/views/widget/widget.cc b/views/widget/widget.cc index aeaebad8..dd40007 100644 --- a/views/widget/widget.cc +++ b/views/widget/widget.cc @@ -28,6 +28,8 @@ Widget::CreateParams::CreateParams() delete_on_destroy(true), mirror_origin_in_rtl(false), has_dropshadow(false), + parent(NULL), + parent_widget(NULL), native_widget(NULL) { } @@ -41,12 +43,19 @@ Widget::CreateParams::CreateParams(Type type) delete_on_destroy(true), mirror_origin_in_rtl(false), has_dropshadow(false), + parent(NULL), + parent_widget(NULL), native_widget(NULL) { } //////////////////////////////////////////////////////////////////////////////// // Widget, public: +// static +Widget::CreateParams Widget::WindowCreateParams() { + return CreateParams(CreateParams::TYPE_WINDOW); +} + Widget::Widget() : is_mouse_button_pressed_(false), last_mouse_event_was_move_(false), @@ -58,19 +67,13 @@ Widget::Widget() Widget::~Widget() { } -void Widget::SetCreateParams(const CreateParams& params) { - native_widget_->SetCreateParams(params); -} - -// Unconverted methods (see header) -------------------------------------------- - -void Widget::Init(gfx::NativeView parent, const gfx::Rect& bounds) { +void Widget::Init(const CreateParams& params) { GetRootView(); default_theme_provider_.reset(new DefaultThemeProvider); + native_widget_->InitNativeWidget(params); } -void Widget::InitWithWidget(Widget* parent, const gfx::Rect& bounds) { -} +// Unconverted methods (see header) -------------------------------------------- gfx::NativeView Widget::GetNativeView() const { return NULL; |