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 "chrome/browser/chromeos/events/event_rewriter.h" | 5 #include "chrome/browser/chromeos/events/event_rewriter.h" |
6 | 6 |
7 #include <X11/keysym.h> | 7 #include <X11/keysym.h> |
8 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #undef Bool | 10 #undef Bool |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "ui/events/x/touch_factory_x11.h" | 36 #include "ui/events/x/touch_factory_x11.h" |
37 #include "ui/gfx/x/x11_types.h" | 37 #include "ui/gfx/x/x11_types.h" |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 std::string GetExpectedResultAsString(ui::KeyboardCode ui_keycode, | 41 std::string GetExpectedResultAsString(ui::KeyboardCode ui_keycode, |
42 int ui_flags, | 42 int ui_flags, |
43 ui::EventType ui_type) { | 43 ui::EventType ui_type) { |
44 return base::StringPrintf("ui_keycode=0x%X ui_flags=0x%X ui_type=%d", | 44 return base::StringPrintf("ui_keycode=0x%X ui_flags=0x%X ui_type=%d", |
45 ui_keycode, | 45 ui_keycode, |
46 ui_flags, | 46 ui_flags & ~ui::EF_IS_REPEAT, |
47 ui_type); | 47 ui_type); |
48 } | 48 } |
49 | 49 |
50 std::string GetKeyEventAsString(const ui::KeyEvent& keyevent) { | 50 std::string GetKeyEventAsString(const ui::KeyEvent& keyevent) { |
51 return GetExpectedResultAsString( | 51 return GetExpectedResultAsString( |
52 keyevent.key_code(), keyevent.flags(), keyevent.type()); | 52 keyevent.key_code(), keyevent.flags(), keyevent.type()); |
53 } | 53 } |
54 | 54 |
55 std::string GetRewrittenEventAsString(chromeos::EventRewriter* rewriter, | 55 std::string GetRewrittenEventAsString(chromeos::EventRewriter* rewriter, |
56 ui::KeyboardCode ui_keycode, | 56 ui::KeyboardCode ui_keycode, |
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 ui::ScopedXI2Event xev; | 1666 ui::ScopedXI2Event xev; |
1667 xev.InitGenericButtonEvent( | 1667 xev.InitGenericButtonEvent( |
1668 11, ui::ET_MOUSE_RELEASED, gfx::Point(), kLeftAndAltFlag); | 1668 11, ui::ET_MOUSE_RELEASED, gfx::Point(), kLeftAndAltFlag); |
1669 ui::MouseEvent release(xev); | 1669 ui::MouseEvent release(xev); |
1670 int flags = RewriteMouseEvent(&rewriter, release); | 1670 int flags = RewriteMouseEvent(&rewriter, release); |
1671 EXPECT_TRUE(ui::EF_RIGHT_MOUSE_BUTTON & flags); | 1671 EXPECT_TRUE(ui::EF_RIGHT_MOUSE_BUTTON & flags); |
1672 } | 1672 } |
1673 } | 1673 } |
1674 | 1674 |
1675 } // namespace chromeos | 1675 } // namespace chromeos |
OLD | NEW |