Index: content/browser/time_zone_monitor_win.cc |
diff --git a/content/browser/time_zone_monitor_win.cc b/content/browser/time_zone_monitor_win.cc |
index 2e8f9a56ed19ca8b5506a135419b771dde6f0286..c7a004bf83c297e331da3bead5606b5ccf2876ae 100644 |
--- a/content/browser/time_zone_monitor_win.cc |
+++ b/content/browser/time_zone_monitor_win.cc |
@@ -7,26 +7,23 @@ |
#include <windows.h> |
#include "base/basictypes.h" |
+#include "base/bind.h" |
+#include "base/bind_helpers.h" |
#include "ui/gfx/win/singleton_hwnd.h" |
namespace content { |
-class TimeZoneMonitorWin : public TimeZoneMonitor, |
- public gfx::SingletonHwnd::Observer { |
+class TimeZoneMonitorWin : public TimeZoneMonitor { |
public: |
TimeZoneMonitorWin() : TimeZoneMonitor() { |
- gfx::SingletonHwnd::GetInstance()->AddObserver(this); |
+ singletonHwndObserver_.SetWndProc( |
+ base::Bind(&TimeZoneMonitorWin::OnTimeChange, base::Unretained(this))); |
} |
- virtual ~TimeZoneMonitorWin() { |
- gfx::SingletonHwnd::GetInstance()->RemoveObserver(this); |
- } |
+ virtual ~TimeZoneMonitorWin() {} |
- // gfx::SingletonHwnd::Observer implementation. |
- virtual void OnWndProc(HWND hwnd, |
- UINT message, |
- WPARAM wparam, |
- LPARAM lparam) override { |
+ private: |
+ void OnTimeChange(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { |
if (message != WM_TIMECHANGE) { |
return; |
} |
@@ -34,7 +31,8 @@ class TimeZoneMonitorWin : public TimeZoneMonitor, |
NotifyRenderers(); |
} |
- private: |
+ gfx::SingletonHwnd::Observer singletonHwndObserver_; |
sky
2015/04/24 20:58:23
unix_hacker_style
robliao
2015/04/24 21:49:03
Done.
|
+ |
DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorWin); |
}; |