diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-17 00:01:57 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-17 00:01:57 +0000 |
commit | f92a69826846102dfe32ac44bc36df79f803beb6 (patch) | |
tree | 35995131920888be482b8eea6cbce3d96803e15b /chrome/views | |
parent | cb1cdf49dfef2a86f5616be04f07381ec00ce1b9 (diff) | |
download | chromium_src-f92a69826846102dfe32ac44bc36df79f803beb6.zip chromium_src-f92a69826846102dfe32ac44bc36df79f803beb6.tar.gz chromium_src-f92a69826846102dfe32ac44bc36df79f803beb6.tar.bz2 |
revert r8217 until memory tests are fixed.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r-- | chrome/views/window.cc | 25 | ||||
-rw-r--r-- | chrome/views/window.h | 14 |
2 files changed, 5 insertions, 34 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc index 1a3ad56..c09ffd0 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -6,6 +6,8 @@ #include "base/win_util.h" #include "chrome/app/chrome_dll_resource.h" +// TODO(beng): some day make this unfortunate dependency not exist. +#include "chrome/browser/browser_list.h" #include "chrome/common/gfx/chrome_font.h" #include "chrome/common/gfx/icon_util.h" #include "chrome/common/l10n_util.h" @@ -34,10 +36,7 @@ static const int kMonitorEdgePadding = 10; // Window, public: Window::~Window() { - if (!IsAppWindow()) { - NotificationService::current()->RemoveObserver( - this, NOTIFY_ALL_APPWINDOWS_CLOSED, NotificationService::AllSources()); - } + BrowserList::RemoveDependentWindow(this); } // static @@ -228,19 +227,6 @@ gfx::Size Window::GetLocalizedContentsSize(int col_resource_id, GetLocalizedContentsHeight(row_resource_id)); } -//////////////////////////////////////////////////////////////////////////////// -// Window, NotificationObserver implementation: - -void Window::Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { - // This window is closed when the last app window is closed. - DCHECK(type == NOTIFY_ALL_APPWINDOWS_CLOSED); - // Only registered as an observer when we're not an app window. - DCHECK(!IsAppWindow()); - Close(); -} - /////////////////////////////////////////////////////////////////////////////// // Window, protected: @@ -265,10 +251,7 @@ 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()); - } + BrowserList::AddDependentWindow(this); } void Window::Init(HWND parent, const gfx::Rect& bounds) { diff --git a/chrome/views/window.h b/chrome/views/window.h index c1c097f..bdd3d6d 100644 --- a/chrome/views/window.h +++ b/chrome/views/window.h @@ -5,7 +5,6 @@ #ifndef CHROME_VIEWS_WINDOW_H__ #define CHROME_VIEWS_WINDOW_H__ -#include "chrome/common/notification_service.h" #include "chrome/views/widget_win.h" namespace gfx { @@ -31,8 +30,7 @@ class WindowDelegate; // rendered by the operating system. // /////////////////////////////////////////////////////////////////////////////// -class Window : public WidgetWin, - public NotificationObserver { +class Window : public WidgetWin { public: virtual ~Window(); @@ -123,11 +121,6 @@ class Window : public WidgetWin, static gfx::Size GetLocalizedContentsSize(int col_resource_id, int row_resource_id); - // NotificationObserver overrides: - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - protected: // Constructs the Window. |window_delegate| cannot be NULL. explicit Window(WindowDelegate* window_delegate); @@ -150,11 +143,6 @@ class Window : public WidgetWin, // Sizes the window to the default size specified by its ClientView. virtual void SizeWindowToDefault(); - // Returns true if the Window is considered to be an "app window" - i.e. any - // window which when it is the last of its type closed causes the application - // to exit. - virtual bool IsAppWindow() const { return false; } - void set_client_view(ClientView* client_view) { client_view_ = client_view; } // Shows the system menu at the specified screen point. |