Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "views/widget/native_widget_win.h" | 5 #include "views/widget/native_widget_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1768 !IsRectEmpty(&dirty_rect)) { | 1768 !IsRectEmpty(&dirty_rect)) { |
| 1769 if (delegate_->OnNativeWidgetPaintAccelerated( | 1769 if (delegate_->OnNativeWidgetPaintAccelerated( |
| 1770 gfx::Rect(dirty_rect))) { | 1770 gfx::Rect(dirty_rect))) { |
| 1771 ValidateRect(hwnd(), NULL); | 1771 ValidateRect(hwnd(), NULL); |
| 1772 } else { | 1772 } else { |
| 1773 scoped_ptr<gfx::CanvasPaint> canvas( | 1773 scoped_ptr<gfx::CanvasPaint> canvas( |
| 1774 gfx::CanvasPaint::CreateCanvasPaint(hwnd())); | 1774 gfx::CanvasPaint::CreateCanvasPaint(hwnd())); |
| 1775 delegate_->OnNativeWidgetPaint(canvas->AsCanvas()); | 1775 delegate_->OnNativeWidgetPaint(canvas->AsCanvas()); |
| 1776 } | 1776 } |
| 1777 } | 1777 } |
| 1778 // TODO(msw): Find a better solution for crbug.com/93530; nix this workaround. | |
|
MAD
2011/11/15 19:39:52
Shouldn't we only do this in an else statement?
msw
2011/11/15 20:12:19
Done.
| |
| 1779 // Some scenarios otherwise fail to validate minimized app/popup windows. | |
| 1780 ValidateRect(hwnd(), NULL); | |
| 1778 } | 1781 } |
| 1779 | 1782 |
| 1780 LRESULT NativeWidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { | 1783 LRESULT NativeWidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { |
| 1781 base::SystemMonitor* monitor = base::SystemMonitor::Get(); | 1784 base::SystemMonitor* monitor = base::SystemMonitor::Get(); |
| 1782 if (monitor) | 1785 if (monitor) |
| 1783 monitor->ProcessWmPowerBroadcastMessage(power_event); | 1786 monitor->ProcessWmPowerBroadcastMessage(power_event); |
| 1784 SetMsgHandled(FALSE); | 1787 SetMsgHandled(FALSE); |
| 1785 return 0; | 1788 return 0; |
| 1786 } | 1789 } |
| 1787 | 1790 |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2516 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2519 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2517 (GetKeyState(VK_RBUTTON) & 0x80) || | 2520 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2518 (GetKeyState(VK_MBUTTON) & 0x80) || | 2521 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2519 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2522 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2520 (GetKeyState(VK_XBUTTON2) & 0x80); | 2523 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2521 } | 2524 } |
| 2522 | 2525 |
| 2523 } // namespace internal | 2526 } // namespace internal |
| 2524 | 2527 |
| 2525 } // namespace views | 2528 } // namespace views |
| OLD | NEW |