| 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 "ash/virtual_keyboard_controller.h" | 5 #include "ash/virtual_keyboard_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.
h" | 10 #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.
h" |
| 11 #include "ash/common/system/tray/system_tray_notifier.h" | 11 #include "ash/common/system/tray/system_tray_notifier.h" |
| 12 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 12 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 13 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard
.h" | 13 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard
.h" |
| 14 #include "ash/common/wm_shell.h" | |
| 15 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 16 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
| 17 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 18 #include "ui/events/devices/device_data_manager.h" | 17 #include "ui/events/devices/device_data_manager.h" |
| 19 #include "ui/events/devices/device_hotplug_event_observer.h" | 18 #include "ui/events/devices/device_hotplug_event_observer.h" |
| 20 #include "ui/events/devices/input_device.h" | 19 #include "ui/events/devices/input_device.h" |
| 21 #include "ui/events/devices/touchscreen_device.h" | 20 #include "ui/events/devices/touchscreen_device.h" |
| 22 #include "ui/keyboard/keyboard_export.h" | 21 #include "ui/keyboard/keyboard_export.h" |
| 23 #include "ui/keyboard/keyboard_switches.h" | 22 #include "ui/keyboard/keyboard_switches.h" |
| 24 #include "ui/keyboard/keyboard_util.h" | 23 #include "ui/keyboard/keyboard_util.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 public: | 108 public: |
| 110 VirtualKeyboardControllerAutoTest() : notified_(false), suppressed_(false) {} | 109 VirtualKeyboardControllerAutoTest() : notified_(false), suppressed_(false) {} |
| 111 ~VirtualKeyboardControllerAutoTest() override {} | 110 ~VirtualKeyboardControllerAutoTest() override {} |
| 112 | 111 |
| 113 void SetUp() override { | 112 void SetUp() override { |
| 114 AshTestBase::SetUp(); | 113 AshTestBase::SetUp(); |
| 115 // Set the current list of devices to empty so that they don't interfere | 114 // Set the current list of devices to empty so that they don't interfere |
| 116 // with the test. | 115 // with the test. |
| 117 UpdateKeyboardDevices(std::vector<ui::InputDevice>()); | 116 UpdateKeyboardDevices(std::vector<ui::InputDevice>()); |
| 118 UpdateTouchscreenDevices(std::vector<ui::TouchscreenDevice>()); | 117 UpdateTouchscreenDevices(std::vector<ui::TouchscreenDevice>()); |
| 119 WmShell::Get()->system_tray_notifier()->AddVirtualKeyboardObserver(this); | 118 Shell::Get()->system_tray_notifier()->AddVirtualKeyboardObserver(this); |
| 120 } | 119 } |
| 121 | 120 |
| 122 void TearDown() override { | 121 void TearDown() override { |
| 123 WmShell::Get()->system_tray_notifier()->RemoveVirtualKeyboardObserver(this); | 122 Shell::Get()->system_tray_notifier()->RemoveVirtualKeyboardObserver(this); |
| 124 AshTestBase::TearDown(); | 123 AshTestBase::TearDown(); |
| 125 } | 124 } |
| 126 | 125 |
| 127 void OnKeyboardSuppressionChanged(bool suppressed) override { | 126 void OnKeyboardSuppressionChanged(bool suppressed) override { |
| 128 notified_ = true; | 127 notified_ = true; |
| 129 suppressed_ = suppressed; | 128 suppressed_ = suppressed; |
| 130 } | 129 } |
| 131 | 130 |
| 132 void ResetObserver() { | 131 void ResetObserver() { |
| 133 suppressed_ = false; | 132 suppressed_ = false; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 UpdateTouchscreenDevices(screens); | 330 UpdateTouchscreenDevices(screens); |
| 332 std::vector<ui::InputDevice> keyboard_devices; | 331 std::vector<ui::InputDevice> keyboard_devices; |
| 333 keyboard_devices.push_back(ui::InputDevice( | 332 keyboard_devices.push_back(ui::InputDevice( |
| 334 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); | 333 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); |
| 335 UpdateKeyboardDevices(keyboard_devices); | 334 UpdateKeyboardDevices(keyboard_devices); |
| 336 ASSERT_TRUE(keyboard::IsKeyboardEnabled()); | 335 ASSERT_TRUE(keyboard::IsKeyboardEnabled()); |
| 337 } | 336 } |
| 338 | 337 |
| 339 } // namespace test | 338 } // namespace test |
| 340 } // namespace ash | 339 } // namespace ash |
| OLD | NEW |