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 | |
63 PostKeyEvent(ui::ET_KEY_PRESSED, key, flags); | 58 PostKeyEvent(ui::ET_KEY_PRESSED, key, flags); |
64 PostKeyEvent(ui::ET_KEY_RELEASED, key, flags); | 59 PostKeyEvent(ui::ET_KEY_RELEASED, key, flags); |
65 | 60 |
66 if (alt) { | 61 if (alt) { |
67 flags &= ~ui::EF_ALT_DOWN; | 62 flags &= ~ui::EF_ALT_DOWN; |
68 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_MENU, flags); | 63 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_MENU, flags); |
69 } | 64 } |
70 | 65 |
71 if (shift) { | 66 if (shift) { |
72 flags &= ~ui::EF_SHIFT_DOWN; | 67 flags &= ~ui::EF_SHIFT_DOWN; |
73 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, flags); | 68 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, flags); |
74 } | 69 } |
75 | 70 |
76 if (control) { | 71 if (control) { |
77 flags &= ~ui::EF_CONTROL_DOWN; | 72 flags &= ~ui::EF_CONTROL_DOWN; |
78 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_CONTROL, flags); | 73 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_CONTROL, flags); |
79 } | 74 } |
80 | 75 |
81 if (command) { | |
82 flags &= ~ui::EF_COMMAND_DOWN; | |
83 PostKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_LWIN, flags); | |
84 } | |
85 | |
86 RunClosureAfterAllPendingUIEvents(closure); | 76 RunClosureAfterAllPendingUIEvents(closure); |
87 return true; | 77 return true; |
88 } | 78 } |
89 | 79 |
90 virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE { | 80 virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE { |
91 return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure()); | 81 return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure()); |
92 } | 82 } |
93 virtual bool SendMouseMoveNotifyWhenDone( | 83 virtual bool SendMouseMoveNotifyWhenDone( |
94 long screen_x, | 84 long screen_x, |
95 long screen_y, | 85 long screen_y, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 }; | 213 }; |
224 | 214 |
225 } // namespace | 215 } // namespace |
226 | 216 |
227 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 217 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
228 return new UIControlsOzone(host); | 218 return new UIControlsOzone(host); |
229 } | 219 } |
230 | 220 |
231 } // namespace test | 221 } // namespace test |
232 } // namespace aura | 222 } // namespace aura |
OLD | NEW |