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

Unified Diff: ui/base/win/events_win.cc

Issue 10454064: ui: Use utility functions from base/win throughout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use GetModifiersFromKeyState() Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/ime/input_method_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/events_win.cc
diff --git a/ui/base/win/events_win.cc b/ui/base/win/events_win.cc
index a014ce06280590dfc3a182a1d00e697a5a08e0cf..bb7a3402d0a0a9a9eb212ab813463f0fec43fdff 100644
--- a/ui/base/win/events_win.cc
+++ b/ui/base/win/events_win.cc
@@ -84,9 +84,9 @@ bool IsKeyEvent(const base::NativeEvent& native_event) {
// Checks the current global state and the state sent by client mouse messages.
int KeyStateFlagsFromNative(const base::NativeEvent& native_event) {
int flags = 0;
- flags |= (GetKeyState(VK_MENU) & 0x80) ? ui::EF_ALT_DOWN : 0;
- flags |= (GetKeyState(VK_SHIFT) & 0x80) ? ui::EF_SHIFT_DOWN : 0;
- flags |= (GetKeyState(VK_CONTROL) & 0x80) ? ui::EF_CONTROL_DOWN : 0;
+ flags |= base::win::IsAltPressed() ? ui::EF_ALT_DOWN : ui::EF_NONE;
tfarina 2012/05/30 00:04:29 this code is duplicated with GetModifiersFromKeySt
+ flags |= base::win::IsShiftPressed() ? ui::EF_SHIFT_DOWN : ui::EF_NONE;
+ flags |= base::win::IsCtrlPressed() ? ui::EF_CONTROL_DOWN : ui::EF_NONE;
// Check key messages for the extended key flag.
if (IsKeyEvent(native_event))
« no previous file with comments | « no previous file | ui/views/ime/input_method_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698