1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_
6 #define CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/profiler/scoped_tracker.h"
13 #include "content/common/content_export.h"
17 class CONTENT_EXPORT SystemMessageWindowWin
{
19 SystemMessageWindowWin();
21 virtual ~SystemMessageWindowWin();
23 virtual LRESULT
OnDeviceChange(UINT event_type
, LPARAM data
);
28 LRESULT CALLBACK
WndProc(HWND hwnd
, UINT message
,
29 WPARAM wparam
, LPARAM lparam
);
31 static LRESULT CALLBACK
WndProcThunk(HWND hwnd
,
35 // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
36 tracked_objects::ScopedTracker
tracking_profile(
37 FROM_HERE_WITH_EXPLICIT_FUNCTION(
38 "440919 SystemMessageWindowWin::WndProcThunk"));
40 SystemMessageWindowWin
* msg_wnd
= reinterpret_cast<SystemMessageWindowWin
*>(
41 GetWindowLongPtr(hwnd
, GWLP_USERDATA
));
43 return msg_wnd
->WndProc(hwnd
, message
, wparam
, lparam
);
44 return ::DefWindowProc(hwnd
, message
, wparam
, lparam
);
49 class DeviceNotifications
;
50 scoped_ptr
<DeviceNotifications
> device_notifications_
;
52 DISALLOW_COPY_AND_ASSIGN(SystemMessageWindowWin
);
55 } // namespace content
57 #endif // CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_