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 MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ |
| 6 #define MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ |
| 7 |
| 8 #include "mojo/services/window_manager/focus_rules.h" |
| 9 |
| 10 namespace mojo { |
| 11 |
| 12 class WindowManagerApp; |
| 13 class View; |
| 14 |
| 15 // The focusing rules used inside a window manager. |
| 16 // |
| 17 // This is intended to be a user supplyable, subclassable component passed to |
| 18 // WindowManagerApp, allowing for the creation of other window managers. |
| 19 // |
| 20 // TODO(erg): This was a straight move of the minimal focus rules from when |
| 21 // WindowManagerApp directly used the wm::FocusController. This implementation |
| 22 // is very incomplete. crbug.com/431047 |
| 23 class BasicFocusRules : public FocusRules { |
| 24 public: |
| 25 BasicFocusRules(mojo::WindowManagerApp* window_manager_app, |
| 26 mojo::View* window_container); |
| 27 ~BasicFocusRules() override; |
| 28 |
| 29 protected: |
| 30 // Overridden from mojo::FocusRules: |
| 31 bool IsToplevelView(mojo::View* view) const override; |
| 32 bool CanActivateView(mojo::View* view) const override; |
| 33 bool CanFocusView(mojo::View* view) const override; |
| 34 mojo::View* GetToplevelView(mojo::View* view) const override; |
| 35 mojo::View* GetActivatableView(mojo::View* view) const override; |
| 36 mojo::View* GetFocusableView(mojo::View* view) const override; |
| 37 mojo::View* GetNextActivatableView(mojo::View* activatable) const override; |
| 38 |
| 39 private: |
| 40 mojo::View* window_container_; |
| 41 mojo::WindowManagerApp* window_manager_app_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(BasicFocusRules); |
| 44 }; |
| 45 |
| 46 } // namespace mojo |
| 47 |
| 48 #endif // MOJO_SERIVCES_WINDOW_MANAGER_BASIC_FOCUS_RULES_H_ |
OLD | NEW |