Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: views/widget/native_widget_win.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « views/widget/native_widget_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « views/widget/native_widget_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698