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/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/system_monitor/system_monitor.h" | |
13 #include "base/win/windows_version.h" | 12 #include "base/win/windows_version.h" |
14 #include "ui/base/events/event.h" | 13 #include "ui/base/events/event.h" |
15 #include "ui/base/events/event_utils.h" | 14 #include "ui/base/events/event_utils.h" |
16 #include "ui/base/keycodes/keyboard_code_conversion_win.h" | 15 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
17 #include "ui/base/win/hwnd_util.h" | 16 #include "ui/base/win/hwnd_util.h" |
18 #include "ui/base/win/mouse_wheel_util.h" | 17 #include "ui/base/win/mouse_wheel_util.h" |
19 #include "ui/base/win/shell.h" | 18 #include "ui/base/win/shell.h" |
20 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
21 #include "ui/gfx/canvas_skia_paint.h" | 20 #include "ui/gfx/canvas_skia_paint.h" |
22 #include "ui/gfx/icon_util.h" | 21 #include "ui/gfx/icon_util.h" |
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 delegate_->HandlePaint(canvas->AsCanvas()); | 1880 delegate_->HandlePaint(canvas->AsCanvas()); |
1882 #endif | 1881 #endif |
1883 } | 1882 } |
1884 } else { | 1883 } else { |
1885 // TODO(msw): Find a better solution for this crbug.com/93530 workaround. | 1884 // TODO(msw): Find a better solution for this crbug.com/93530 workaround. |
1886 // Some scenarios otherwise fail to validate minimized app/popup windows. | 1885 // Some scenarios otherwise fail to validate minimized app/popup windows. |
1887 ValidateRect(hwnd(), NULL); | 1886 ValidateRect(hwnd(), NULL); |
1888 } | 1887 } |
1889 } | 1888 } |
1890 | 1889 |
1891 LRESULT HWNDMessageHandler::OnPowerBroadcast(DWORD power_event, DWORD data) { | |
1892 base::SystemMonitor* monitor = base::SystemMonitor::Get(); | |
1893 if (monitor) | |
1894 monitor->ProcessWmPowerBroadcastMessage(power_event); | |
1895 SetMsgHandled(FALSE); | |
1896 return 0; | |
1897 } | |
1898 | |
1899 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message, | 1890 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message, |
1900 WPARAM w_param, | 1891 WPARAM w_param, |
1901 LPARAM l_param) { | 1892 LPARAM l_param) { |
1902 SetMsgHandled(FALSE); | 1893 SetMsgHandled(FALSE); |
1903 return 0; | 1894 return 0; |
1904 } | 1895 } |
1905 | 1896 |
1906 LRESULT HWNDMessageHandler::OnSetCursor(UINT message, | 1897 LRESULT HWNDMessageHandler::OnSetCursor(UINT message, |
1907 WPARAM w_param, | 1898 WPARAM w_param, |
1908 LPARAM l_param) { | 1899 LPARAM l_param) { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2138 DwmExtendFrameIntoClientArea(hwnd(), &m); | 2129 DwmExtendFrameIntoClientArea(hwnd(), &m); |
2139 } | 2130 } |
2140 if (window_pos->flags & SWP_SHOWWINDOW) | 2131 if (window_pos->flags & SWP_SHOWWINDOW) |
2141 delegate_->HandleVisibilityChanged(true); | 2132 delegate_->HandleVisibilityChanged(true); |
2142 else if (window_pos->flags & SWP_HIDEWINDOW) | 2133 else if (window_pos->flags & SWP_HIDEWINDOW) |
2143 delegate_->HandleVisibilityChanged(false); | 2134 delegate_->HandleVisibilityChanged(false); |
2144 SetMsgHandled(FALSE); | 2135 SetMsgHandled(FALSE); |
2145 } | 2136 } |
2146 | 2137 |
2147 } // namespace views | 2138 } // namespace views |
OLD | NEW |