keyboard_observer.h 1010 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2017 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 COMPONENTS_EXO_KEYBOARD_OBSERVER_H_
  5. #define COMPONENTS_EXO_KEYBOARD_OBSERVER_H_
  6. namespace exo {
  7. class Keyboard;
  8. // Observers to the Keyboard are notified when the Keyboard destructs.
  9. class KeyboardObserver {
  10. public:
  11. virtual ~KeyboardObserver() = default;
  12. // Called at the top of the keyboard's destructor, to give observers a change
  13. // to remove themselves.
  14. virtual void OnKeyboardDestroying(Keyboard* keyboard) {}
  15. // Called just before KeyboardDelegate::OnKeyboardKey().
  16. // KeyboardDelegate::OnKeyboardKey() may not be called, specifically if IME
  17. // consumed the key event, but this is always.
  18. virtual void OnKeyboardKey(base::TimeTicks time_stamp,
  19. ui::DomCode code,
  20. bool pressed) {}
  21. };
  22. } // namespace exo
  23. #endif // COMPONENTS_EXO_KEYBOARD_OBSERVER_H_