diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 22:03:10 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 22:03:10 +0000 |
commit | 94098fe02a8c5950df6453ccca7621a2d2a6816f (patch) | |
tree | 202c8855a76a7e11bb88fb46fe409a3c4d0888cd /views/window/window.cc | |
parent | 172f155f817cc56e1ca36bee6aeeca7f8f95bb64 (diff) | |
download | chromium_src-94098fe02a8c5950df6453ccca7621a2d2a6816f.zip chromium_src-94098fe02a8c5950df6453ccca7621a2d2a6816f.tar.gz chromium_src-94098fe02a8c5950df6453ccca7621a2d2a6816f.tar.bz2 |
Move WindowDelegate and NonClientView creation and management to Window.
This makes WindowGtk/WindowWin a little uglier for now, will improve with consolidation of more functions into Window.
BUG=72040
TEST=none
Review URL: http://codereview.chromium.org/6621033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window/window.cc')
-rw-r--r-- | views/window/window.cc | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/views/window/window.cc b/views/window/window.cc index 3a14335..5531cff 100644 --- a/views/window/window.cc +++ b/views/window/window.cc @@ -11,13 +11,21 @@ #include "ui/gfx/rect.h" #include "ui/gfx/size.h" #include "views/widget/widget.h" +#include "views/window/window_delegate.h" namespace views { //////////////////////////////////////////////////////////////////////////////// // Window, public: -Window::Window() : native_window_(NULL) { +Window::Window(WindowDelegate* window_delegate) + : native_window_(NULL), + window_delegate_(window_delegate), + ALLOW_THIS_IN_INITIALIZER_LIST( + non_client_view_(new NonClientView(this))) { + DCHECK(window_delegate_); + DCHECK(!window_delegate_->window_); + window_delegate_->window_ = this; } Window::~Window() { @@ -151,27 +159,28 @@ NonClientFrameView* Window::CreateFrameViewForWindow() { void Window::UpdateFrameAfterFrameChange() { } -WindowDelegate* Window::GetDelegate() const { +gfx::NativeWindow Window::GetNativeWindow() const { return NULL; } -NonClientView* Window::GetNonClientView() const { - return NULL; +bool Window::ShouldUseNativeFrame() const { + return false; } -ClientView* Window::GetClientView() const { - return NULL; +void Window::FrameTypeChanged() { } -gfx::NativeWindow Window::GetNativeWindow() const { - return NULL; -} +//////////////////////////////////////////////////////////////////////////////// +// Window, internal::NativeWindowDelegate implementation: -bool Window::ShouldUseNativeFrame() const { - return false; +void Window::OnWindowDestroying() { + non_client_view_->WindowClosing(); + window_delegate_->WindowClosing(); } -void Window::FrameTypeChanged() { +void Window::OnWindowDestroyed() { + window_delegate_->DeleteDelegate(); + window_delegate_ = NULL; } } // namespace views |