diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:58:53 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:58:53 +0000 |
commit | 18a8790f88e26a524e24ad87a032f90f58d61bac (patch) | |
tree | e7adc664cf77ded4fd0815a9cdc6451d31a47893 /chrome | |
parent | 2ebdac9b2ea2f1c75393b0b49558dd9fcfebc0bb (diff) | |
download | chromium_src-18a8790f88e26a524e24ad87a032f90f58d61bac.zip chromium_src-18a8790f88e26a524e24ad87a032f90f58d61bac.tar.gz chromium_src-18a8790f88e26a524e24ad87a032f90f58d61bac.tar.bz2 |
Fix BrowserTest.WindowsSessionEnd by moving a virtual call
from the constructor to the Init() function().
The virtual call in the constructor of the base class doesn't
get dispatched to the child class since we haven't started to
construct it yet. Instead, defer the call until after we've
finished creating the object.
Review URL: http://codereview.chromium.org/18601
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/views/window.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc index dbc55ed..699d9da 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -265,10 +265,6 @@ Window::Window(WindowDelegate* window_delegate) // behavior before calling Init. set_window_style(0); set_window_ex_style(0); - if (!IsAppWindow()) { - NotificationService::current()->AddObserver( - this, NOTIFY_ALL_APPWINDOWS_CLOSED, NotificationService::AllSources()); - } } void Window::Init(HWND parent, const gfx::Rect& bounds) { @@ -299,6 +295,11 @@ void Window::Init(HWND parent, const gfx::Rect& bounds) { SetClientView(window_delegate_->CreateClientView(this)); SetInitialBounds(bounds); InitAlwaysOnTopState(); + + if (!IsAppWindow()) { + NotificationService::current()->AddObserver( + this, NOTIFY_ALL_APPWINDOWS_CLOSED, NotificationService::AllSources()); + } } void Window::SetClientView(ClientView* client_view) { |