OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 SERVICES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ |
| 6 #define SERVICES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ |
| 7 |
| 8 #include "mojo/services/window_manager/focus_rules.h" |
| 9 |
| 10 namespace mojo { |
| 11 class View; |
| 12 } |
| 13 |
| 14 namespace window_manager { |
| 15 |
| 16 // The focusing rules used inside a window manager. |
| 17 // |
| 18 // This is intended to be a user supplyable, subclassable component passed to |
| 19 // WindowManagerApp, allowing for the creation of other window managers. |
| 20 class BasicFocusRules : public FocusRules { |
| 21 public: |
| 22 BasicFocusRules(mojo::View* window_container); |
| 23 ~BasicFocusRules() override; |
| 24 |
| 25 protected: |
| 26 // Overridden from mojo::FocusRules: |
| 27 bool SupportsChildActivation(mojo::View* view) const override; |
| 28 bool IsToplevelView(mojo::View* view) const override; |
| 29 bool CanActivateView(mojo::View* view) const override; |
| 30 bool CanFocusView(mojo::View* view) const override; |
| 31 mojo::View* GetToplevelView(mojo::View* view) const override; |
| 32 mojo::View* GetActivatableView(mojo::View* view) const override; |
| 33 mojo::View* GetFocusableView(mojo::View* view) const override; |
| 34 mojo::View* GetNextActivatableView(mojo::View* activatable) const override; |
| 35 |
| 36 private: |
| 37 bool CanFocusViewImpl(mojo::View* view) const; |
| 38 |
| 39 // Tests to see if |view| is in |window_container_|. |
| 40 bool IsViewParentedToWindowContainer(mojo::View* view) const; |
| 41 |
| 42 mojo::View* window_container_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(BasicFocusRules); |
| 45 }; |
| 46 |
| 47 } // namespace window_manager |
| 48 |
| 49 #endif // SERVICES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ |
OLD | NEW |