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 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_FOCUS_RULES_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_FOCUS_RULES_H_ 7 8 #include "base/macros.h" 9 #include "ui/wm/core/base_focus_rules.h" 10 11 namespace views { 12 13 class DesktopFocusRules : public wm::BaseFocusRules { 14 public: 15 explicit DesktopFocusRules(aura::Window* content_window); 16 ~DesktopFocusRules() override; 17 18 private: 19 // Overridden from wm::BaseFocusRules: 20 bool CanActivateWindow(const aura::Window* window) const override; 21 bool CanFocusWindow(const aura::Window* window, 22 const ui::Event* event) const override; 23 bool SupportsChildActivation(const aura::Window* window) const override; 24 bool IsWindowConsideredVisibleForActivation( 25 const aura::Window* window) const override; 26 const aura::Window* GetToplevelWindow( 27 const aura::Window* window) const override; 28 aura::Window* GetNextActivatableWindow(aura::Window* window) const override; 29 30 // The content window. This is an activatable window even though it is a 31 // child. 32 aura::Window* content_window_; 33 34 DISALLOW_COPY_AND_ASSIGN(DesktopFocusRules); 35 }; 36 37 } // namespace views 38 39 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_FOCUS_RULES_H_ 40