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