Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Side by Side Diff: content/browser/time_zone_monitor_win.cc

Issue 251613002: Broadcast NotifyTimezoneChange to all RenderProcessHosts when the system time zone changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "content/browser/time_zone_monitor.h"
6
7 #include <windows.h>
8
9 #include "base/basictypes.h"
10 #include "base/logging.h"
11 #include "ui/gfx/win/singleton_hwnd.h"
12
13 namespace content {
14
15 class TimeZoneMonitorWin : public TimeZoneMonitor,
16 public gfx::SingletonHwnd::Observer {
17 public:
18 TimeZoneMonitorWin() : TimeZoneMonitor() {
19 gfx::SingletonHwnd::GetInstance()->AddObserver(this);
20 }
21
22 virtual ~TimeZoneMonitorWin() {
23 gfx::SingletonHwnd::GetInstance()->RemoveObserver(this);
24 }
25
26 // gfx::SingletonHwnd::Observer implementation.
27 virtual void OnWndProc(HWND hwnd,
28 UINT message,
29 WPARAM wparam,
30 LPARAM lparam) OVERRIDE {
31 DCHECK_EQ(hwnd, gfx::SingletonHwnd::GetInstance()->hwnd());
32 if (message != WM_TIMECHANGE) {
33 return;
34 }
35
36 NotifyRenderers();
37 }
38
39 private:
40 DISALLOW_COPY_AND_ASSIGN(TimeZoneMonitorWin);
41 };
42
43 // static
44 TimeZoneMonitor* TimeZoneMonitor::Create() {
45 return new TimeZoneMonitorWin();
46 }
47
48 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698