OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/win/hwnd_message_handler.h" | 5 #include "ui/views/win/hwnd_message_handler.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/system_monitor/system_monitor.h" | 11 #include "base/power_monitor/power_monitor.h" |
12 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
13 #include "ui/base/events/event.h" | 13 #include "ui/base/events/event.h" |
14 #include "ui/base/keycodes/keyboard_code_conversion_win.h" | 14 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
15 #include "ui/base/native_theme/native_theme_win.h" | 15 #include "ui/base/native_theme/native_theme_win.h" |
16 #include "ui/base/win/hwnd_util.h" | 16 #include "ui/base/win/hwnd_util.h" |
17 #include "ui/base/win/mouse_wheel_util.h" | 17 #include "ui/base/win/mouse_wheel_util.h" |
18 #include "ui/base/win/shell.h" | 18 #include "ui/base/win/shell.h" |
19 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
20 #include "ui/gfx/canvas_paint.h" | 20 #include "ui/gfx/canvas_paint.h" |
21 #include "ui/gfx/canvas_skia_paint.h" | 21 #include "ui/gfx/canvas_skia_paint.h" |
(...skipping 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 #endif | 1844 #endif |
1845 } | 1845 } |
1846 } else { | 1846 } else { |
1847 // TODO(msw): Find a better solution for this crbug.com/93530 workaround. | 1847 // TODO(msw): Find a better solution for this crbug.com/93530 workaround. |
1848 // Some scenarios otherwise fail to validate minimized app/popup windows. | 1848 // Some scenarios otherwise fail to validate minimized app/popup windows. |
1849 ValidateRect(hwnd(), NULL); | 1849 ValidateRect(hwnd(), NULL); |
1850 } | 1850 } |
1851 } | 1851 } |
1852 | 1852 |
1853 LRESULT HWNDMessageHandler::OnPowerBroadcast(DWORD power_event, DWORD data) { | 1853 LRESULT HWNDMessageHandler::OnPowerBroadcast(DWORD power_event, DWORD data) { |
1854 base::SystemMonitor* monitor = base::SystemMonitor::Get(); | 1854 base::PowerMonitor* monitor = base::PowerMonitor::GetInstance(); |
1855 if (monitor) | 1855 monitor->ProcessWmPowerBroadcastMessage(power_event); |
1856 monitor->ProcessWmPowerBroadcastMessage(power_event); | |
1857 SetMsgHandled(FALSE); | 1856 SetMsgHandled(FALSE); |
1858 return 0; | 1857 return 0; |
1859 } | 1858 } |
1860 | 1859 |
1861 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message, | 1860 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message, |
1862 WPARAM w_param, | 1861 WPARAM w_param, |
1863 LPARAM l_param) { | 1862 LPARAM l_param) { |
1864 SetMsgHandled(FALSE); | 1863 SetMsgHandled(FALSE); |
1865 return 0; | 1864 return 0; |
1866 } | 1865 } |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 DwmExtendFrameIntoClientArea(hwnd(), &m); | 2090 DwmExtendFrameIntoClientArea(hwnd(), &m); |
2092 } | 2091 } |
2093 if (window_pos->flags & SWP_SHOWWINDOW) | 2092 if (window_pos->flags & SWP_SHOWWINDOW) |
2094 delegate_->HandleVisibilityChanged(true); | 2093 delegate_->HandleVisibilityChanged(true); |
2095 else if (window_pos->flags & SWP_HIDEWINDOW) | 2094 else if (window_pos->flags & SWP_HIDEWINDOW) |
2096 delegate_->HandleVisibilityChanged(false); | 2095 delegate_->HandleVisibilityChanged(false); |
2097 SetMsgHandled(FALSE); | 2096 SetMsgHandled(FALSE); |
2098 } | 2097 } |
2099 | 2098 |
2100 } // namespace views | 2099 } // namespace views |
OLD | NEW |