shell_tab_handler.h 930 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2020 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_SHELL_TAB_HANDLER_H_
  5. #define ASH_SHELL_TAB_HANDLER_H_
  6. #include "ui/events/event_handler.h"
  7. namespace ash {
  8. class Shell;
  9. // Enables handling of tab when there are no non-minimized windows open in the
  10. // shell. This allows keyboard only users to easily get focus to the shelf when
  11. // no windows are open.
  12. class ShellTabHandler : public ui::EventHandler {
  13. public:
  14. explicit ShellTabHandler(Shell* shell) : shell_(shell) {}
  15. ShellTabHandler(const ShellTabHandler&) = delete;
  16. ShellTabHandler& operator=(const ShellTabHandler) = delete;
  17. ~ShellTabHandler() override = default;
  18. // ui::EventHandler:
  19. void OnKeyEvent(ui::KeyEvent* key_event) override;
  20. private:
  21. Shell* const shell_;
  22. };
  23. } // namespace ash
  24. #endif // ASH_SHELL_TAB_HANDLER_H_