| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/window/window_win.h" | 5 #include "views/window/window_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include "app/keyboard_code_conversion_win.h" | |
| 11 #include "app/theme_provider.h" | 10 #include "app/theme_provider.h" |
| 12 #include "app/win/hwnd_util.h" | 11 #include "app/win/hwnd_util.h" |
| 13 #include "app/win/win_util.h" | 12 #include "app/win/win_util.h" |
| 14 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 15 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
| 16 #include "gfx/canvas_skia_paint.h" | 15 #include "gfx/canvas_skia_paint.h" |
| 17 #include "gfx/font.h" | 16 #include "gfx/font.h" |
| 18 #include "gfx/icon_util.h" | 17 #include "gfx/icon_util.h" |
| 19 #include "gfx/path.h" | 18 #include "gfx/path.h" |
| 19 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
| 20 #include "views/accessibility/view_accessibility.h" | 20 #include "views/accessibility/view_accessibility.h" |
| 21 #include "views/widget/root_view.h" | 21 #include "views/widget/root_view.h" |
| 22 #include "views/window/client_view.h" | 22 #include "views/window/client_view.h" |
| 23 #include "views/window/custom_frame_view.h" | 23 #include "views/window/custom_frame_view.h" |
| 24 #include "views/window/native_frame_view.h" | 24 #include "views/window/native_frame_view.h" |
| 25 #include "views/window/non_client_view.h" | 25 #include "views/window/non_client_view.h" |
| 26 #include "views/window/window_delegate.h" | 26 #include "views/window/window_delegate.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 UnlockUpdates(); | 1168 UnlockUpdates(); |
| 1169 } | 1169 } |
| 1170 } | 1170 } |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 // Handle SC_KEYMENU, which means that the user has pressed the ALT | 1173 // Handle SC_KEYMENU, which means that the user has pressed the ALT |
| 1174 // key and released it, so we should focus the menu bar. | 1174 // key and released it, so we should focus the menu bar. |
| 1175 if ((notification_code & sc_mask) == SC_KEYMENU && click.x == 0) { | 1175 if ((notification_code & sc_mask) == SC_KEYMENU && click.x == 0) { |
| 1176 // Retrieve the status of shift and control keys to prevent consuming | 1176 // Retrieve the status of shift and control keys to prevent consuming |
| 1177 // shift+alt keys, which are used by Windows to change input languages. | 1177 // shift+alt keys, which are used by Windows to change input languages. |
| 1178 Accelerator accelerator(app::KeyboardCodeForWindowsKeyCode(VK_MENU), | 1178 Accelerator accelerator(ui::KeyboardCodeForWindowsKeyCode(VK_MENU), |
| 1179 !!(GetKeyState(VK_SHIFT) & 0x8000), | 1179 !!(GetKeyState(VK_SHIFT) & 0x8000), |
| 1180 !!(GetKeyState(VK_CONTROL) & 0x8000), | 1180 !!(GetKeyState(VK_CONTROL) & 0x8000), |
| 1181 false); | 1181 false); |
| 1182 GetFocusManager()->ProcessAccelerator(accelerator); | 1182 GetFocusManager()->ProcessAccelerator(accelerator); |
| 1183 return; | 1183 return; |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 // First see if the delegate can handle it. | 1186 // First see if the delegate can handle it. |
| 1187 if (window_delegate_->ExecuteWindowsCommand(notification_code)) | 1187 if (window_delegate_->ExecuteWindowsCommand(notification_code)) |
| 1188 return; | 1188 return; |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 Window::CloseSecondaryWidget(root_view->GetWidget()); | 1575 Window::CloseSecondaryWidget(root_view->GetWidget()); |
| 1576 return TRUE; | 1576 return TRUE; |
| 1577 } | 1577 } |
| 1578 } // namespace | 1578 } // namespace |
| 1579 | 1579 |
| 1580 void Window::CloseAllSecondaryWindows() { | 1580 void Window::CloseAllSecondaryWindows() { |
| 1581 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); | 1581 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); |
| 1582 } | 1582 } |
| 1583 | 1583 |
| 1584 } // namespace views | 1584 } // namespace views |
| OLD | NEW |