summaryrefslogtreecommitdiffstats
path: root/chrome/views/window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views/window.cc')
-rw-r--r--chrome/views/window.cc25
1 files changed, 4 insertions, 21 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) {