Add Profile::IsChild and IsLegacySupervised
[chromium-blink-merge.git] / ui / wm / core / base_focus_rules.h
blob4ce5e3ab1eecb3c3ab429c40d3ed891b26347a93
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.
5 #ifndef UI_WM_CORE_BASE_FOCUS_RULES_H_
6 #define UI_WM_CORE_BASE_FOCUS_RULES_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/wm/core/focus_rules.h"
12 namespace wm {
14 // A set of basic focus and activation rules. Specializations should most likely
15 // subclass this and call up to these methods rather than reimplementing them.
16 class WM_EXPORT BaseFocusRules : public FocusRules {
17 protected:
18 BaseFocusRules();
19 ~BaseFocusRules() override;
21 // Returns true if the children of |window| can be activated.
22 virtual bool SupportsChildActivation(aura::Window* window) const = 0;
24 // Returns true if |window| is considered visible for activation purposes.
25 virtual bool IsWindowConsideredVisibleForActivation(
26 aura::Window* window) const;
28 // Overridden from FocusRules:
29 bool IsToplevelWindow(aura::Window* window) const override;
30 bool CanActivateWindow(aura::Window* window) const override;
31 bool CanFocusWindow(aura::Window* window) const override;
32 aura::Window* GetToplevelWindow(aura::Window* window) const override;
33 aura::Window* GetActivatableWindow(aura::Window* window) const override;
34 aura::Window* GetFocusableWindow(aura::Window* window) const override;
35 aura::Window* GetNextActivatableWindow(aura::Window* ignore) const override;
37 private:
38 DISALLOW_COPY_AND_ASSIGN(BaseFocusRules);
41 } // namespace wm
43 #endif // UI_WM_CORE_BASE_FOCUS_RULES_H_