| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
| 6 #define CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "build/build_config.h" | |
| 10 | |
| 11 #include <windows.h> | |
| 12 | |
| 13 #include "base/basictypes.h" | |
| 14 #include "content/common/content_export.h" | |
| 15 | |
| 16 class CONTENT_EXPORT SystemMessageWindowWin { | |
| 17 public: | |
| 18 SystemMessageWindowWin(); | |
| 19 virtual ~SystemMessageWindowWin(); | |
| 20 | |
| 21 virtual LRESULT OnDeviceChange(UINT event_type, DWORD data); | |
| 22 | |
| 23 private: | |
| 24 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, | |
| 25 WPARAM wparam, LPARAM lparam); | |
| 26 | |
| 27 static LRESULT CALLBACK WndProcThunk(HWND hwnd, | |
| 28 UINT message, | |
| 29 WPARAM wparam, | |
| 30 LPARAM lparam) { | |
| 31 SystemMessageWindowWin* msg_wnd = reinterpret_cast<SystemMessageWindowWin*>( | |
| 32 GetWindowLongPtr(hwnd, GWLP_USERDATA)); | |
| 33 if (msg_wnd) | |
| 34 return msg_wnd->WndProc(hwnd, message, wparam, lparam); | |
| 35 return ::DefWindowProc(hwnd, message, wparam, lparam); | |
| 36 } | |
| 37 | |
| 38 HWND window_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(SystemMessageWindowWin); | |
| 41 }; | |
| 42 | |
| 43 #endif // CONTENT_BROWSER_SYSTEM_MESSAGE_WINDOW_WIN_H_ | |
| OLD | NEW |