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 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) | WS_VISIBLE); | 1872 SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) | WS_VISIBLE); |
1873 } | 1873 } |
1874 } | 1874 } |
1875 } | 1875 } |
1876 | 1876 |
1877 // Handle SC_KEYMENU, which means that the user has pressed the ALT | 1877 // Handle SC_KEYMENU, which means that the user has pressed the ALT |
1878 // key and released it, so we should focus the menu bar. | 1878 // key and released it, so we should focus the menu bar. |
1879 if ((notification_code & sc_mask) == SC_KEYMENU && click.x == 0) { | 1879 if ((notification_code & sc_mask) == SC_KEYMENU && click.x == 0) { |
1880 // Retrieve the status of shift and control keys to prevent consuming | 1880 // Retrieve the status of shift and control keys to prevent consuming |
1881 // shift+alt keys, which are used by Windows to change input languages. | 1881 // shift+alt keys, which are used by Windows to change input languages. |
1882 Accelerator accelerator(ui::KeyboardCodeForWindowsKeyCode(VK_MENU), | 1882 ui::Accelerator accelerator(ui::KeyboardCodeForWindowsKeyCode(VK_MENU), |
1883 !!(GetKeyState(VK_SHIFT) & 0x8000), | 1883 !!(GetKeyState(VK_SHIFT) & 0x8000), |
1884 !!(GetKeyState(VK_CONTROL) & 0x8000), | 1884 !!(GetKeyState(VK_CONTROL) & 0x8000), |
1885 false); | 1885 false); |
1886 GetWidget()->GetFocusManager()->ProcessAccelerator(accelerator); | 1886 GetWidget()->GetFocusManager()->ProcessAccelerator(accelerator); |
1887 return; | 1887 return; |
1888 } | 1888 } |
1889 | 1889 |
1890 // If the delegate can't handle it, the system implementation will be called. | 1890 // If the delegate can't handle it, the system implementation will be called. |
1891 if (!delegate_->ExecuteCommand(notification_code)) { | 1891 if (!delegate_->ExecuteCommand(notification_code)) { |
1892 DefWindowProc(GetNativeView(), WM_SYSCOMMAND, notification_code, | 1892 DefWindowProc(GetNativeView(), WM_SYSCOMMAND, notification_code, |
1893 MAKELPARAM(click.x, click.y)); | 1893 MAKELPARAM(click.x, click.y)); |
1894 } | 1894 } |
1895 } | 1895 } |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2516 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2516 return (GetKeyState(VK_LBUTTON) & 0x80) || |
2517 (GetKeyState(VK_RBUTTON) & 0x80) || | 2517 (GetKeyState(VK_RBUTTON) & 0x80) || |
2518 (GetKeyState(VK_MBUTTON) & 0x80) || | 2518 (GetKeyState(VK_MBUTTON) & 0x80) || |
2519 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2519 (GetKeyState(VK_XBUTTON1) & 0x80) || |
2520 (GetKeyState(VK_XBUTTON2) & 0x80); | 2520 (GetKeyState(VK_XBUTTON2) & 0x80); |
2521 } | 2521 } |
2522 | 2522 |
2523 } // namespace internal | 2523 } // namespace internal |
2524 | 2524 |
2525 } // namespace views | 2525 } // namespace views |
OLD | NEW |