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

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 11821050: Move power event handling logic from ui/ to base/ on Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add message only window into base/ Created 7 years, 10 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
OLDNEW
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 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 delegate_->HandlePaint(canvas->AsCanvas()); 1863 delegate_->HandlePaint(canvas->AsCanvas());
1865 #endif 1864 #endif
1866 } 1865 }
1867 } else { 1866 } else {
1868 // TODO(msw): Find a better solution for this crbug.com/93530 workaround. 1867 // TODO(msw): Find a better solution for this crbug.com/93530 workaround.
1869 // Some scenarios otherwise fail to validate minimized app/popup windows. 1868 // Some scenarios otherwise fail to validate minimized app/popup windows.
1870 ValidateRect(hwnd(), NULL); 1869 ValidateRect(hwnd(), NULL);
1871 } 1870 }
1872 } 1871 }
1873 1872
1874 LRESULT HWNDMessageHandler::OnPowerBroadcast(DWORD power_event, DWORD data) {
1875 base::SystemMonitor* monitor = base::SystemMonitor::Get();
1876 if (monitor)
1877 monitor->ProcessWmPowerBroadcastMessage(power_event);
1878 SetMsgHandled(FALSE);
1879 return 0;
1880 }
1881
1882 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message, 1873 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message,
1883 WPARAM w_param, 1874 WPARAM w_param,
1884 LPARAM l_param) { 1875 LPARAM l_param) {
1885 SetMsgHandled(FALSE); 1876 SetMsgHandled(FALSE);
1886 return 0; 1877 return 0;
1887 } 1878 }
1888 1879
1889 LRESULT HWNDMessageHandler::OnSetCursor(UINT message, 1880 LRESULT HWNDMessageHandler::OnSetCursor(UINT message,
1890 WPARAM w_param, 1881 WPARAM w_param,
1891 LPARAM l_param) { 1882 LPARAM l_param) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 DwmExtendFrameIntoClientArea(hwnd(), &m); 2112 DwmExtendFrameIntoClientArea(hwnd(), &m);
2122 } 2113 }
2123 if (window_pos->flags & SWP_SHOWWINDOW) 2114 if (window_pos->flags & SWP_SHOWWINDOW)
2124 delegate_->HandleVisibilityChanged(true); 2115 delegate_->HandleVisibilityChanged(true);
2125 else if (window_pos->flags & SWP_HIDEWINDOW) 2116 else if (window_pos->flags & SWP_HIDEWINDOW)
2126 delegate_->HandleVisibilityChanged(false); 2117 delegate_->HandleVisibilityChanged(false);
2127 SetMsgHandled(FALSE); 2118 SetMsgHandled(FALSE);
2128 } 2119 }
2129 2120
2130 } // namespace views 2121 } // namespace views
OLDNEW
« base/system_monitor/system_monitor_win.cc ('K') | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698