Index: ui/gfx/screen_win.cc |
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc |
index 9210971d7b45d63865c6de2dd1dc0f2a9c75d7e1..91e8d24bc42f7a16070296237e26a7d05f830258 100644 |
--- a/ui/gfx/screen_win.cc |
+++ b/ui/gfx/screen_win.cc |
@@ -6,6 +6,8 @@ |
#include <windows.h> |
+#include "base/bind.h" |
+#include "base/bind_helpers.h" |
#include "base/hash.h" |
#include "base/logging.h" |
#include "base/strings/utf_string_conversions.h" |
@@ -86,12 +88,11 @@ namespace gfx { |
ScreenWin::ScreenWin() |
: displays_(GetDisplays()) { |
- SingletonHwnd::GetInstance()->AddObserver(this); |
+ singletonHwndObserver_.SetWndProc( |
+ base::Bind(&ScreenWin::OnDisplayChange, base::Unretained(this))); |
} |
-ScreenWin::~ScreenWin() { |
- SingletonHwnd::GetInstance()->RemoveObserver(this); |
-} |
+ScreenWin::~ScreenWin() {} |
gfx::Point ScreenWin::GetCursorScreenPoint() { |
POINT pt; |
@@ -176,10 +177,10 @@ void ScreenWin::RemoveObserver(DisplayObserver* observer) { |
change_notifier_.RemoveObserver(observer); |
} |
-void ScreenWin::OnWndProc(HWND hwnd, |
- UINT message, |
- WPARAM wparam, |
- LPARAM lparam) { |
+void ScreenWin::OnDisplayChange(HWND hwnd, |
+ UINT message, |
+ WPARAM wparam, |
+ LPARAM lparam) { |
if (message != WM_DISPLAYCHANGE) |
return; |