1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/time_zone_monitor.h"
9 #include "base/basictypes.h"
10 #include "base/bind.h"
11 #include "base/bind_helpers.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "ui/gfx/win/singleton_hwnd_observer.h"
17 class TimeZoneMonitorWin
: public TimeZoneMonitor
{
21 singleton_hwnd_observer_(
22 new gfx::SingletonHwndObserver(base::Bind(
23 &TimeZoneMonitorWin::OnWndProc
, base::Unretained(this)))) {}
25 ~TimeZoneMonitorWin() override
{}
28 void OnWndProc(HWND hwnd
, UINT message
, WPARAM wparam
, LPARAM lparam
) {
29 if (message
!= WM_TIMECHANGE
) {
36 scoped_ptr
<gfx::SingletonHwndObserver
> singleton_hwnd_observer_
;
38 DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorWin
);
42 scoped_ptr
<TimeZoneMonitor
> TimeZoneMonitor::Create() {
43 return scoped_ptr
<TimeZoneMonitor
>(new TimeZoneMonitorWin());
46 } // namespace content