| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cstring> | 5 #include <cstring> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 10 #include <X11/Xutil.h> | 10 #include <X11/Xutil.h> |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 0); | 546 0); |
| 547 EXPECT_EQ(ui::ET_KEY_PRESSED, ui::EventTypeFromNative(xev)); | 547 EXPECT_EQ(ui::ET_KEY_PRESSED, ui::EventTypeFromNative(xev)); |
| 548 xev.InitGenericKeyEvent(master_device_id, | 548 xev.InitGenericKeyEvent(master_device_id, |
| 549 other_device_id, | 549 other_device_id, |
| 550 ui::ET_KEY_PRESSED, | 550 ui::ET_KEY_PRESSED, |
| 551 ui::VKEY_B, | 551 ui::VKEY_B, |
| 552 0); | 552 0); |
| 553 EXPECT_EQ(ui::ET_KEY_PRESSED, ui::EventTypeFromNative(xev)); | 553 EXPECT_EQ(ui::ET_KEY_PRESSED, ui::EventTypeFromNative(xev)); |
| 554 | 554 |
| 555 device_data_manager->EnableDevice(blocked_device_id); | 555 device_data_manager->EnableDevice(blocked_device_id); |
| 556 device_data_manager->SetDisabledKeyboardAllowedKeys( | 556 device_data_manager->SetDisabledKeyboardAllowedKeys(nullptr); |
| 557 scoped_ptr<std::set<KeyboardCode> >()); | |
| 558 | 557 |
| 559 // A key returns KEY_PRESSED as per usual now that keyboard was re-enabled. | 558 // A key returns KEY_PRESSED as per usual now that keyboard was re-enabled. |
| 560 xev.InitGenericKeyEvent(master_device_id, | 559 xev.InitGenericKeyEvent(master_device_id, |
| 561 blocked_device_id, | 560 blocked_device_id, |
| 562 ui::ET_KEY_PRESSED, | 561 ui::ET_KEY_PRESSED, |
| 563 ui::VKEY_A, | 562 ui::VKEY_A, |
| 564 0); | 563 0); |
| 565 EXPECT_EQ(ui::ET_KEY_PRESSED, ui::EventTypeFromNative(xev)); | 564 EXPECT_EQ(ui::ET_KEY_PRESSED, ui::EventTypeFromNative(xev)); |
| 566 } | 565 } |
| 567 | 566 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 KeyEventTestApi test_event(&key_event); | 628 KeyEventTestApi test_event(&key_event); |
| 630 test_event.set_is_char(true); | 629 test_event.set_is_char(true); |
| 631 } | 630 } |
| 632 EXPECT_FALSE(key_event.flags() & ui::EF_IME_FABRICATED_KEY); | 631 EXPECT_FALSE(key_event.flags() & ui::EF_IME_FABRICATED_KEY); |
| 633 } | 632 } |
| 634 } | 633 } |
| 635 } | 634 } |
| 636 #endif | 635 #endif |
| 637 | 636 |
| 638 } // namespace ui | 637 } // namespace ui |
| OLD | NEW |