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

Unified Diff: ui/views/widget/native_widget_win.cc

Issue 10454064: ui: Use utility functions from base/win throughout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include win_util.h 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 | « ui/views/ime/input_method_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_win.cc
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index da0e0ebeeacef6e0de4046f3d93b8db310301ee4..1cca6fd2dad8db163e011767ca3ff17da328b691 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -1575,8 +1575,8 @@ LRESULT NativeWidgetWin::OnMouseRange(UINT message,
// doing this undesirable thing, but that means we need to roll the
// sys-command handling ourselves.
// Combine |w_param| with common key state message flags.
- w_param |= ((GetKeyState(VK_CONTROL) & 0x80) == 0x80)? MK_CONTROL : 0;
- w_param |= ((GetKeyState(VK_SHIFT) & 0x80) == 0x80)? MK_SHIFT : 0;
+ w_param |= base::win::IsCtrlPressed() ? MK_CONTROL : 0;
+ w_param |= base::win::IsShiftPressed() ? MK_SHIFT : 0;
}
}
} else if (message == WM_NCRBUTTONDOWN &&
@@ -2035,9 +2035,9 @@ void NativeWidgetWin::OnSysCommand(UINT notification_code, CPoint click) {
// key and released it, so we should focus the menu bar.
if ((notification_code & sc_mask) == SC_KEYMENU && click.x == 0) {
int modifiers = ui::EF_NONE;
- if (!!(GetKeyState(VK_SHIFT) & 0x8000))
+ if (base::win::IsShiftPressed())
modifiers |= ui::EF_SHIFT_DOWN;
- if (!!(GetKeyState(VK_CONTROL) & 0x8000))
+ if (base::win::IsCtrlPressed())
modifiers |= ui::EF_CONTROL_DOWN;
// Retrieve the status of shift and control keys to prevent consuming
// shift+alt keys, which are used by Windows to change input languages.
« no previous file with comments | « ui/views/ime/input_method_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698