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

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

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update patch per vandebo's comments Created 8 years, 2 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/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 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 #endif 1845 #endif
1846 } 1846 }
1847 } else { 1847 } else {
1848 // TODO(msw): Find a better solution for this crbug.com/93530 workaround. 1848 // TODO(msw): Find a better solution for this crbug.com/93530 workaround.
1849 // Some scenarios otherwise fail to validate minimized app/popup windows. 1849 // Some scenarios otherwise fail to validate minimized app/popup windows.
1850 ValidateRect(hwnd(), NULL); 1850 ValidateRect(hwnd(), NULL);
1851 } 1851 }
1852 } 1852 }
1853 1853
1854 LRESULT HWNDMessageHandler::OnPowerBroadcast(DWORD power_event, DWORD data) { 1854 LRESULT HWNDMessageHandler::OnPowerBroadcast(DWORD power_event, DWORD data) {
1855 base::SystemMonitor* monitor = base::SystemMonitor::Get(); 1855 base::PowerMonitor* monitor = base::PowerMonitor::GetInstance();
1856 if (monitor) 1856 monitor->ProcessWmPowerBroadcastMessage(power_event);
1857 monitor->ProcessWmPowerBroadcastMessage(power_event);
1858 SetMsgHandled(FALSE); 1857 SetMsgHandled(FALSE);
1859 return 0; 1858 return 0;
1860 } 1859 }
1861 1860
1862 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message, 1861 LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message,
1863 WPARAM w_param, 1862 WPARAM w_param,
1864 LPARAM l_param) { 1863 LPARAM l_param) {
1865 SetMsgHandled(FALSE); 1864 SetMsgHandled(FALSE);
1866 return 0; 1865 return 0;
1867 } 1866 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 DwmExtendFrameIntoClientArea(hwnd(), &m); 2091 DwmExtendFrameIntoClientArea(hwnd(), &m);
2093 } 2092 }
2094 if (window_pos->flags & SWP_SHOWWINDOW) 2093 if (window_pos->flags & SWP_SHOWWINDOW)
2095 delegate_->HandleVisibilityChanged(true); 2094 delegate_->HandleVisibilityChanged(true);
2096 else if (window_pos->flags & SWP_HIDEWINDOW) 2095 else if (window_pos->flags & SWP_HIDEWINDOW)
2097 delegate_->HandleVisibilityChanged(false); 2096 delegate_->HandleVisibilityChanged(false);
2098 SetMsgHandled(FALSE); 2097 SetMsgHandled(FALSE);
2099 } 2098 }
2100 2099
2101 } // namespace views 2100 } // namespace views
OLDNEW
« chrome/browser/profiles/profile_manager_unittest.cc ('K') | « net/url_request/url_request_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698