| 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 "ui/chromeos/touch_exploration_controller.h" | 5 #include "ui/chromeos/touch_exploration_controller.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "ui/aura/client/cursor_client.h" | 8 #include "ui/aura/client/cursor_client.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 result |= BOTTOM_EDGE; | 741 result |= BOTTOM_EDGE; |
| 742 return result; | 742 return result; |
| 743 } | 743 } |
| 744 | 744 |
| 745 void TouchExplorationController::DispatchShiftSearchKeyEvent( | 745 void TouchExplorationController::DispatchShiftSearchKeyEvent( |
| 746 const ui::KeyboardCode direction) { | 746 const ui::KeyboardCode direction) { |
| 747 // In order to activate the shortcut shift+search+<arrow key> | 747 // In order to activate the shortcut shift+search+<arrow key> |
| 748 // three KeyPressed events must be dispatched in succession along | 748 // three KeyPressed events must be dispatched in succession along |
| 749 // with three KeyReleased events. | 749 // with three KeyReleased events. |
| 750 ui::KeyEvent shift_down = ui::KeyEvent( | 750 ui::KeyEvent shift_down = ui::KeyEvent( |
| 751 ui::ET_KEY_PRESSED, ui::VKEY_SHIFT, ui::EF_SHIFT_DOWN, false); | 751 ui::ET_KEY_PRESSED, ui::VKEY_SHIFT, ui::EF_SHIFT_DOWN); |
| 752 ui::KeyEvent search_down = ui::KeyEvent( | 752 ui::KeyEvent search_down = ui::KeyEvent( |
| 753 ui::ET_KEY_PRESSED, kChromeOSSearchKey, ui::EF_SHIFT_DOWN, false); | 753 ui::ET_KEY_PRESSED, kChromeOSSearchKey, ui::EF_SHIFT_DOWN); |
| 754 ui::KeyEvent direction_down = | 754 ui::KeyEvent direction_down = |
| 755 ui::KeyEvent(ui::ET_KEY_PRESSED, direction, ui::EF_SHIFT_DOWN, false); | 755 ui::KeyEvent(ui::ET_KEY_PRESSED, direction, ui::EF_SHIFT_DOWN); |
| 756 | 756 |
| 757 ui::KeyEvent direction_up = | 757 ui::KeyEvent direction_up = |
| 758 ui::KeyEvent(ui::ET_KEY_RELEASED, direction, ui::EF_SHIFT_DOWN, false); | 758 ui::KeyEvent(ui::ET_KEY_RELEASED, direction, ui::EF_SHIFT_DOWN); |
| 759 ui::KeyEvent search_up = ui::KeyEvent( | 759 ui::KeyEvent search_up = ui::KeyEvent( |
| 760 ui::ET_KEY_RELEASED, kChromeOSSearchKey, ui::EF_SHIFT_DOWN, false); | 760 ui::ET_KEY_RELEASED, kChromeOSSearchKey, ui::EF_SHIFT_DOWN); |
| 761 ui::KeyEvent shift_up = | 761 ui::KeyEvent shift_up = |
| 762 ui::KeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, ui::EF_NONE, false); | 762 ui::KeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_SHIFT, ui::EF_NONE); |
| 763 | 763 |
| 764 DispatchEvent(&shift_down); | 764 DispatchEvent(&shift_down); |
| 765 DispatchEvent(&search_down); | 765 DispatchEvent(&search_down); |
| 766 DispatchEvent(&direction_down); | 766 DispatchEvent(&direction_down); |
| 767 DispatchEvent(&direction_up); | 767 DispatchEvent(&direction_up); |
| 768 DispatchEvent(&search_up); | 768 DispatchEvent(&search_up); |
| 769 DispatchEvent(&shift_up); | 769 DispatchEvent(&shift_up); |
| 770 } | 770 } |
| 771 | 771 |
| 772 scoped_ptr<ui::Event> TouchExplorationController::CreateMouseMoveEvent( | 772 scoped_ptr<ui::Event> TouchExplorationController::CreateMouseMoveEvent( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 return "PASSTHROUGH"; | 865 return "PASSTHROUGH"; |
| 866 case WAIT_FOR_RELEASE: | 866 case WAIT_FOR_RELEASE: |
| 867 return "WAIT_FOR_RELEASE"; | 867 return "WAIT_FOR_RELEASE"; |
| 868 case SLIDE_GESTURE: | 868 case SLIDE_GESTURE: |
| 869 return "SLIDE_GESTURE"; | 869 return "SLIDE_GESTURE"; |
| 870 } | 870 } |
| 871 return "Not a state"; | 871 return "Not a state"; |
| 872 } | 872 } |
| 873 | 873 |
| 874 } // namespace ui | 874 } // namespace ui |
| OLD | NEW |