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

Unified Diff: ui/base/test/ui_controls_mac.mm

Issue 2970673003: Reorder SynthesizeKeyEvent to ensure it matches other platforms
Patch Set: Created 3 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/ui_controls_mac.mm
diff --git a/ui/base/test/ui_controls_mac.mm b/ui/base/test/ui_controls_mac.mm
index c0af6900d0c099e284bf9ac4cc6a991e86d25951..70f1e90b4c8600f3bf8681f2e48734512cc187a0 100644
--- a/ui/base/test/ui_controls_mac.mm
+++ b/ui/base/test/ui_controls_mac.mm
@@ -79,6 +79,12 @@ void SynthesizeKeyEventsSequence(NSWindow* window,
DCHECK(event);
events->push_back(event);
}
+ if (command) {
+ flags |= NSCommandKeyMask;
+ event = SynthesizeKeyEvent(window, true, ui::VKEY_COMMAND, flags);
+ DCHECK(event);
+ events->push_back(event);
+ }
if (shift) {
flags |= NSShiftKeyMask;
event = SynthesizeKeyEvent(window, true, ui::VKEY_SHIFT, flags);
@@ -91,12 +97,6 @@ void SynthesizeKeyEventsSequence(NSWindow* window,
DCHECK(event);
events->push_back(event);
}
- if (command) {
- flags |= NSCommandKeyMask;
- event = SynthesizeKeyEvent(window, true, ui::VKEY_COMMAND, flags);
- DCHECK(event);
- events->push_back(event);
- }
event = SynthesizeKeyEvent(window, true, keycode, flags);
DCHECK(event);
@@ -105,12 +105,6 @@ void SynthesizeKeyEventsSequence(NSWindow* window,
DCHECK(event);
events->push_back(event);
- if (command) {
- flags &= ~NSCommandKeyMask;
- event = SynthesizeKeyEvent(window, false, ui::VKEY_COMMAND, flags);
- DCHECK(event);
- events->push_back(event);
- }
if (alt) {
flags &= ~NSAlternateKeyMask;
event = SynthesizeKeyEvent(window, false, ui::VKEY_MENU, flags);
@@ -123,6 +117,12 @@ void SynthesizeKeyEventsSequence(NSWindow* window,
DCHECK(event);
events->push_back(event);
}
+ if (command) {
+ flags &= ~NSCommandKeyMask;
+ event = SynthesizeKeyEvent(window, false, ui::VKEY_COMMAND, flags);
+ DCHECK(event);
+ events->push_back(event);
+ }
if (control) {
flags &= ~NSControlKeyMask;
event = SynthesizeKeyEvent(window, false, ui::VKEY_CONTROL, flags);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698