| 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 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 if (GetUpdateRect(hwnd(), &dirty_rect, FALSE) && | 1767 if (GetUpdateRect(hwnd(), &dirty_rect, FALSE) && |
| 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 } else { |
| 1778 // TODO(msw): Find a better solution for this crbug.com/93530 workaround. |
| 1779 // Some scenarios otherwise fail to validate minimized app/popup windows. |
| 1780 ValidateRect(hwnd(), NULL); |
| 1777 } | 1781 } |
| 1778 } | 1782 } |
| 1779 | 1783 |
| 1780 LRESULT NativeWidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { | 1784 LRESULT NativeWidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { |
| 1781 base::SystemMonitor* monitor = base::SystemMonitor::Get(); | 1785 base::SystemMonitor* monitor = base::SystemMonitor::Get(); |
| 1782 if (monitor) | 1786 if (monitor) |
| 1783 monitor->ProcessWmPowerBroadcastMessage(power_event); | 1787 monitor->ProcessWmPowerBroadcastMessage(power_event); |
| 1784 SetMsgHandled(FALSE); | 1788 SetMsgHandled(FALSE); |
| 1785 return 0; | 1789 return 0; |
| 1786 } | 1790 } |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2520 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2517 (GetKeyState(VK_RBUTTON) & 0x80) || | 2521 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2518 (GetKeyState(VK_MBUTTON) & 0x80) || | 2522 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2519 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2523 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2520 (GetKeyState(VK_XBUTTON2) & 0x80); | 2524 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2521 } | 2525 } |
| 2522 | 2526 |
| 2523 } // namespace internal | 2527 } // namespace internal |
| 2524 | 2528 |
| 2525 } // namespace views | 2529 } // namespace views |
| OLD | NEW |