| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/wm/sticky_keys.h" | 5 #include "ash/wm/sticky_keys.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 #undef None | 8 #undef None |
| 9 #undef Bool | 9 #undef Bool |
| 10 #undef RootWindow | 10 #undef RootWindow |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 dispatcher.set_target(target_); | 228 dispatcher.set_target(target_); |
| 229 return event; | 229 return event; |
| 230 } | 230 } |
| 231 | 231 |
| 232 // Creates a synthesized MouseEvent that is not backed by a native event. | 232 // Creates a synthesized MouseEvent that is not backed by a native event. |
| 233 ui::MouseEvent* GenerateSynthesizedMouseEvent(bool is_button_press) { | 233 ui::MouseEvent* GenerateSynthesizedMouseEvent(bool is_button_press) { |
| 234 ui::MouseEvent* event = new ui::MouseEvent( | 234 ui::MouseEvent* event = new ui::MouseEvent( |
| 235 is_button_press ? ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED, | 235 is_button_press ? ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED, |
| 236 gfx::Point(0, 0), | 236 gfx::Point(0, 0), |
| 237 gfx::Point(0, 0), | 237 gfx::Point(0, 0), |
| 238 ui::EF_LEFT_MOUSE_BUTTON, |
| 238 ui::EF_LEFT_MOUSE_BUTTON); | 239 ui::EF_LEFT_MOUSE_BUTTON); |
| 239 ui::Event::DispatcherApi dispatcher(event); | 240 ui::Event::DispatcherApi dispatcher(event); |
| 240 dispatcher.set_target(target_); | 241 dispatcher.set_target(target_); |
| 241 return event; | 242 return event; |
| 242 } | 243 } |
| 243 | 244 |
| 244 void SendActivateStickyKeyPattern(StickyKeysHandler* handler, | 245 void SendActivateStickyKeyPattern(StickyKeysHandler* handler, |
| 245 ui::KeyboardCode key_code) { | 246 ui::KeyboardCode key_code) { |
| 246 scoped_ptr<ui::KeyEvent> ev; | 247 scoped_ptr<ui::KeyEvent> ev; |
| 247 ev.reset(GenerateKey(true, key_code)); | 248 ev.reset(GenerateKey(true, key_code)); |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 static_cast<ui::MouseWheelEvent*>(events[0])->y_offset()); | 868 static_cast<ui::MouseWheelEvent*>(events[0])->y_offset()); |
| 868 EXPECT_TRUE(events[0]->flags() & ui::EF_CONTROL_DOWN); | 869 EXPECT_TRUE(events[0]->flags() & ui::EF_CONTROL_DOWN); |
| 869 EXPECT_EQ(ui::ET_KEY_RELEASED, events[1]->type()); | 870 EXPECT_EQ(ui::ET_KEY_RELEASED, events[1]->type()); |
| 870 EXPECT_EQ(ui::VKEY_CONTROL, | 871 EXPECT_EQ(ui::VKEY_CONTROL, |
| 871 static_cast<ui::KeyEvent*>(events[1])->key_code()); | 872 static_cast<ui::KeyEvent*>(events[1])->key_code()); |
| 872 | 873 |
| 873 Shell::GetInstance()->RemovePreTargetHandler(&buffer); | 874 Shell::GetInstance()->RemovePreTargetHandler(&buffer); |
| 874 } | 875 } |
| 875 | 876 |
| 876 } // namespace ash | 877 } // namespace ash |
| OLD | NEW |