OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "ui/aura/client/screen_position_client.h" | 7 #include "ui/aura/client/screen_position_client.h" |
8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
9 #include "ui/aura/test/aura_test_utils.h" | 9 #include "ui/aura/test/aura_test_utils.h" |
10 #include "ui/aura/test/ui_controls_factory_aura.h" | 10 #include "ui/aura/test/ui_controls_factory_aura.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 if (shift) { | 48 if (shift) { |
49 flags |= ui::EF_SHIFT_DOWN; | 49 flags |= ui::EF_SHIFT_DOWN; |
50 PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_SHIFT, flags); | 50 PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_SHIFT, flags); |
51 } | 51 } |
52 | 52 |
53 if (alt) { | 53 if (alt) { |
54 flags |= ui::EF_ALT_DOWN; | 54 flags |= ui::EF_ALT_DOWN; |
55 PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_MENU, flags); | 55 PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_MENU, flags); |
56 } | 56 } |
57 | 57 |
| 58 if (command) { |
| 59 flags |= ui::EF_COMMAND_DOWN; |
| 60 PostKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_LWIN, flags); |
| 61 } |
| 62 |
58 PostKeyEvent(ui::ET_KEY_PRESSED, key, flags); | 63 PostKeyEvent(ui::ET_KEY_PRESSED, key, flags); |
59 PostKeyEvent(ui::ET_KEY_RELEASED, key, flags); | 64 PostKeyEvent(ui::ET_KEY_RELEASED, key, flags); |
60 | 65 |
61 if (alt) { | 66 if (alt) { |
62 flags &= ~ui::EF_ALT_DOWN; | 67 flags &= ~ui::EF_ALT_DOWN; |
63 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_MENU, flags); | 68 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_MENU, flags); |
64 } | 69 } |
65 | 70 |
66 if (shift) { | 71 if (shift) { |
67 flags &= ~ui::EF_SHIFT_DOWN; | 72 flags &= ~ui::EF_SHIFT_DOWN; |
68 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, flags); | 73 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, flags); |
69 } | 74 } |
70 | 75 |
71 if (control) { | 76 if (control) { |
72 flags &= ~ui::EF_CONTROL_DOWN; | 77 flags &= ~ui::EF_CONTROL_DOWN; |
73 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_CONTROL, flags); | 78 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_CONTROL, flags); |
74 } | 79 } |
75 | 80 |
| 81 if (command) { |
| 82 flags &= ~ui::EF_COMMAND_DOWN; |
| 83 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_LWIN, flags); |
| 84 } |
| 85 |
76 RunClosureAfterAllPendingUIEvents(closure); | 86 RunClosureAfterAllPendingUIEvents(closure); |
77 return true; | 87 return true; |
78 } | 88 } |
79 | 89 |
80 virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE { | 90 virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE { |
81 return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure()); | 91 return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure()); |
82 } | 92 } |
83 virtual bool SendMouseMoveNotifyWhenDone( | 93 virtual bool SendMouseMoveNotifyWhenDone( |
84 long screen_x, | 94 long screen_x, |
85 long screen_y, | 95 long screen_y, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 }; | 223 }; |
214 | 224 |
215 } // namespace | 225 } // namespace |
216 | 226 |
217 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 227 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
218 return new UIControlsOzone(host); | 228 return new UIControlsOzone(host); |
219 } | 229 } |
220 | 230 |
221 } // namespace test | 231 } // namespace test |
222 } // namespace aura | 232 } // namespace aura |
OLD | NEW |