| 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 "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "views/controls/native_control_win.h" | 32 #include "views/controls/native_control_win.h" |
| 33 #include "views/controls/textfield/native_textfield_views.h" | 33 #include "views/controls/textfield/native_textfield_views.h" |
| 34 #include "views/focus/accelerator_handler.h" | 34 #include "views/focus/accelerator_handler.h" |
| 35 #include "views/focus/focus_util_win.h" | 35 #include "views/focus/focus_util_win.h" |
| 36 #include "views/focus/view_storage.h" | 36 #include "views/focus/view_storage.h" |
| 37 #include "views/ime/input_method_win.h" | 37 #include "views/ime/input_method_win.h" |
| 38 #include "views/views_delegate.h" | 38 #include "views/views_delegate.h" |
| 39 #include "views/widget/aero_tooltip_manager.h" | 39 #include "views/widget/aero_tooltip_manager.h" |
| 40 #include "views/widget/child_window_message_processor.h" | 40 #include "views/widget/child_window_message_processor.h" |
| 41 #include "views/widget/drop_target_win.h" | 41 #include "views/widget/drop_target_win.h" |
| 42 #include "views/widget/monitor_win.h" |
| 42 #include "views/widget/native_widget_delegate.h" | 43 #include "views/widget/native_widget_delegate.h" |
| 43 #include "views/widget/native_widget_views.h" | 44 #include "views/widget/native_widget_views.h" |
| 44 #include "views/widget/root_view.h" | 45 #include "views/widget/root_view.h" |
| 45 #include "views/widget/widget_delegate.h" | 46 #include "views/widget/widget_delegate.h" |
| 46 #include "views/window/native_frame_view.h" | 47 #include "views/window/native_frame_view.h" |
| 47 | 48 |
| 48 #pragma comment(lib, "dwmapi.lib") | 49 #pragma comment(lib, "dwmapi.lib") |
| 49 | 50 |
| 50 using ui::ViewProp; | 51 using ui::ViewProp; |
| 51 | 52 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 if (!*monitor) | 279 if (!*monitor) |
| 279 return false; | 280 return false; |
| 280 MONITORINFO monitor_info = { 0 }; | 281 MONITORINFO monitor_info = { 0 }; |
| 281 monitor_info.cbSize = sizeof(monitor_info); | 282 monitor_info.cbSize = sizeof(monitor_info); |
| 282 GetMonitorInfo(*monitor, &monitor_info); | 283 GetMonitorInfo(*monitor, &monitor_info); |
| 283 *monitor_rect = monitor_info.rcMonitor; | 284 *monitor_rect = monitor_info.rcMonitor; |
| 284 *work_area = monitor_info.rcWork; | 285 *work_area = monitor_info.rcWork; |
| 285 return true; | 286 return true; |
| 286 } | 287 } |
| 287 | 288 |
| 288 // Returns true if edge |edge| (one of ABE_LEFT, TOP, RIGHT, or BOTTOM) of | |
| 289 // monitor |monitor| has an auto-hiding taskbar that's always-on-top. | |
| 290 bool EdgeHasTopmostAutoHideTaskbar(UINT edge, HMONITOR monitor) { | |
| 291 APPBARDATA taskbar_data = { 0 }; | |
| 292 taskbar_data.cbSize = sizeof APPBARDATA; | |
| 293 taskbar_data.uEdge = edge; | |
| 294 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, | |
| 295 &taskbar_data)); | |
| 296 return ::IsWindow(taskbar) && (monitor != NULL) && | |
| 297 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) && | |
| 298 (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST); | |
| 299 } | |
| 300 | |
| 301 // Links the HWND to its NativeWidget. | 289 // Links the HWND to its NativeWidget. |
| 302 const char* const kNativeWidgetKey = "__VIEWS_NATIVE_WIDGET__"; | 290 const char* const kNativeWidgetKey = "__VIEWS_NATIVE_WIDGET__"; |
| 303 | 291 |
| 304 // A custom MSAA object id used to determine if a screen reader is actively | 292 // A custom MSAA object id used to determine if a screen reader is actively |
| 305 // listening for MSAA events. | 293 // listening for MSAA events. |
| 306 const int kCustomObjectID = 1; | 294 const int kCustomObjectID = 1; |
| 307 | 295 |
| 308 // If the hung renderer warning doesn't fit on screen, the amount of padding to | 296 // If the hung renderer warning doesn't fit on screen, the amount of padding to |
| 309 // be left between the edge of the window and the edge of the nearest monitor, | 297 // be left between the edge of the window and the edge of the nearest monitor, |
| 310 // after the window is nudged back on screen. Pixels. | 298 // after the window is nudged back on screen. Pixels. |
| (...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2562 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2550 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2563 (GetKeyState(VK_RBUTTON) & 0x80) || | 2551 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2564 (GetKeyState(VK_MBUTTON) & 0x80) || | 2552 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2565 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2553 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2566 (GetKeyState(VK_XBUTTON2) & 0x80); | 2554 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2567 } | 2555 } |
| 2568 | 2556 |
| 2569 } // namespace internal | 2557 } // namespace internal |
| 2570 | 2558 |
| 2571 } // namespace views | 2559 } // namespace views |
| OLD | NEW |