ash_focus_rules.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (c) 2012 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_WM_ASH_FOCUS_RULES_H_
  5. #define ASH_WM_ASH_FOCUS_RULES_H_
  6. #include <vector>
  7. #include "ash/ash_export.h"
  8. #include "ui/wm/core/base_focus_rules.h"
  9. namespace ash {
  10. class ASH_EXPORT AshFocusRules : public ::wm::BaseFocusRules {
  11. public:
  12. AshFocusRules();
  13. AshFocusRules(const AshFocusRules&) = delete;
  14. AshFocusRules& operator=(const AshFocusRules&) = delete;
  15. ~AshFocusRules() override;
  16. // ::wm::BaseFocusRules:
  17. bool IsToplevelWindow(const aura::Window* window) const override;
  18. bool SupportsChildActivation(const aura::Window* window) const override;
  19. bool IsWindowConsideredVisibleForActivation(
  20. const aura::Window* window) const override;
  21. bool CanActivateWindow(const aura::Window* window) const override;
  22. bool CanFocusWindow(const aura::Window* window,
  23. const ui::Event* event) const override;
  24. aura::Window* GetNextActivatableWindow(aura::Window* ignore) const override;
  25. private:
  26. aura::Window* GetTopmostWindowToActivateForContainerIndex(
  27. int index,
  28. aura::Window* ignore) const;
  29. aura::Window* GetTopmostWindowToActivateInContainer(
  30. aura::Window* container,
  31. aura::Window* ignore) const;
  32. // List of container IDs in the order of actiavation. This list doesn't change
  33. // for the lifetime of this object.
  34. const std::vector<int> activatable_container_ids_;
  35. };
  36. } // namespace ash
  37. #endif // ASH_WM_ASH_FOCUS_RULES_H_