| 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/widget/native_widget_win.h" | 5 #include "ui/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 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 ::SetFocus(GetNativeView()); | 1115 ::SetFocus(GetNativeView()); |
| 1116 } | 1116 } |
| 1117 | 1117 |
| 1118 void NativeWidgetWin::FocusNativeView(gfx::NativeView native_view) { | 1118 void NativeWidgetWin::FocusNativeView(gfx::NativeView native_view) { |
| 1119 // Only reset focus if hwnd is not already focused. | 1119 // Only reset focus if hwnd is not already focused. |
| 1120 if (native_view && ::GetFocus() != native_view) | 1120 if (native_view && ::GetFocus() != native_view) |
| 1121 ::SetFocus(native_view); | 1121 ::SetFocus(native_view); |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 gfx::Rect NativeWidgetWin::GetWorkAreaBoundsInScreen() const { | 1124 gfx::Rect NativeWidgetWin::GetWorkAreaBoundsInScreen() const { |
| 1125 return gfx::Screen::GetMonitorWorkAreaNearestWindow(GetNativeView()); | 1125 return gfx::Screen::GetMonitorNearestWindow(GetNativeView()).work_area(); |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 void NativeWidgetWin::SetInactiveRenderingDisabled(bool value) { | 1128 void NativeWidgetWin::SetInactiveRenderingDisabled(bool value) { |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 Widget::MoveLoopResult NativeWidgetWin::RunMoveLoop() { | 1131 Widget::MoveLoopResult NativeWidgetWin::RunMoveLoop() { |
| 1132 ReleaseCapture(); | 1132 ReleaseCapture(); |
| 1133 MoveLoopMouseWatcher watcher(this); | 1133 MoveLoopMouseWatcher watcher(this); |
| 1134 SendMessage(hwnd(), WM_SYSCOMMAND, SC_MOVE | 0x0002, GetMessagePos()); | 1134 SendMessage(hwnd(), WM_SYSCOMMAND, SC_MOVE | 0x0002, GetMessagePos()); |
| 1135 // Windows doesn't appear to offer a way to determine whether the user | 1135 // Windows doesn't appear to offer a way to determine whether the user |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2646 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2646 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2647 (GetKeyState(VK_RBUTTON) & 0x80) || | 2647 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2648 (GetKeyState(VK_MBUTTON) & 0x80) || | 2648 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2649 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2649 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2650 (GetKeyState(VK_XBUTTON2) & 0x80); | 2650 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2651 } | 2651 } |
| 2652 | 2652 |
| 2653 } // namespace internal | 2653 } // namespace internal |
| 2654 | 2654 |
| 2655 } // namespace views | 2655 } // namespace views |
| OLD | NEW |