test_keyboard_ui.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_KEYBOARD_TEST_KEYBOARD_UI_H_
  5. #define ASH_KEYBOARD_TEST_KEYBOARD_UI_H_
  6. #include <memory>
  7. #include "ash/keyboard/ui/keyboard_ui.h"
  8. #include "ash/keyboard/ui/keyboard_ui_factory.h"
  9. #include "ui/aura/test/test_window_delegate.h"
  10. namespace aura {
  11. class Window;
  12. } // namespace aura
  13. namespace ash {
  14. // Stub implementation of keyboard::KeyboardUI
  15. class TestKeyboardUI : public keyboard::KeyboardUI {
  16. public:
  17. TestKeyboardUI();
  18. TestKeyboardUI(const TestKeyboardUI&) = delete;
  19. TestKeyboardUI& operator=(const TestKeyboardUI&) = delete;
  20. ~TestKeyboardUI() override;
  21. // Overridden from KeyboardUI:
  22. aura::Window* LoadKeyboardWindow(LoadCallback callback) override;
  23. aura::Window* GetKeyboardWindow() const override;
  24. ui::GestureConsumer* GetGestureConsumer() const override;
  25. private:
  26. // Overridden from keyboard::KeyboardUI:
  27. ui::InputMethod* GetInputMethod() override;
  28. void ReloadKeyboardIfNeeded() override;
  29. aura::test::TestWindowDelegate delegate_;
  30. std::unique_ptr<aura::Window> keyboard_window_;
  31. };
  32. class TestKeyboardUIFactory : public keyboard::KeyboardUIFactory {
  33. public:
  34. TestKeyboardUIFactory();
  35. TestKeyboardUIFactory(const TestKeyboardUIFactory&) = delete;
  36. TestKeyboardUIFactory& operator=(const TestKeyboardUIFactory&) = delete;
  37. ~TestKeyboardUIFactory() override;
  38. private:
  39. // keyboard::KeyboardUIFactory:
  40. std::unique_ptr<keyboard::KeyboardUI> CreateKeyboardUI() override;
  41. };
  42. } // namespace ash
  43. #endif // ASH_KEYBOARD_TEST_KEYBOARD_UI_H_