OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_WM_CORE_FOCUS_CONTROLLER_H_ | 5 #ifndef UI_WM_CORE_FOCUS_CONTROLLER_H_ |
6 #define UI_WM_CORE_FOCUS_CONTROLLER_H_ | 6 #define UI_WM_CORE_FOCUS_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // itself as an observer of the active and focused windows). | 42 // itself as an observer of the active and focused windows). |
43 class WM_EXPORT FocusController : public aura::client::ActivationClient, | 43 class WM_EXPORT FocusController : public aura::client::ActivationClient, |
44 public aura::client::FocusClient, | 44 public aura::client::FocusClient, |
45 public ui::EventHandler, | 45 public ui::EventHandler, |
46 public aura::WindowObserver { | 46 public aura::WindowObserver { |
47 public: | 47 public: |
48 // |rules| cannot be NULL. | 48 // |rules| cannot be NULL. |
49 explicit FocusController(FocusRules* rules); | 49 explicit FocusController(FocusRules* rules); |
50 ~FocusController() override; | 50 ~FocusController() override; |
51 | 51 |
52 private: | 52 protected: |
53 // Overridden from aura::client::ActivationClient: | 53 // Overridden from aura::client::ActivationClient: |
54 void AddObserver(aura::client::ActivationChangeObserver* observer) override; | 54 void AddObserver(aura::client::ActivationChangeObserver* observer) override; |
55 void RemoveObserver( | 55 void RemoveObserver( |
56 aura::client::ActivationChangeObserver* observer) override; | 56 aura::client::ActivationChangeObserver* observer) override; |
57 void ActivateWindow(aura::Window* window) override; | 57 void ActivateWindow(aura::Window* window) override; |
58 void DeactivateWindow(aura::Window* window) override; | 58 void DeactivateWindow(aura::Window* window) override; |
59 aura::Window* GetActiveWindow() override; | 59 aura::Window* GetActiveWindow() override; |
60 aura::Window* GetActivatableWindow(aura::Window* window) override; | 60 aura::Window* GetActivatableWindow(aura::Window* window) override; |
61 aura::Window* GetToplevelWindow(aura::Window* window) override; | 61 aura::Window* GetToplevelWindow(aura::Window* window) override; |
62 bool CanActivateWindow(aura::Window* window) const override; | 62 bool CanActivateWindow(aura::Window* window) const override; |
(...skipping 11 matching lines...) Expand all Loading... |
74 void OnScrollEvent(ui::ScrollEvent* event) override; | 74 void OnScrollEvent(ui::ScrollEvent* event) override; |
75 void OnTouchEvent(ui::TouchEvent* event) override; | 75 void OnTouchEvent(ui::TouchEvent* event) override; |
76 void OnGestureEvent(ui::GestureEvent* event) override; | 76 void OnGestureEvent(ui::GestureEvent* event) override; |
77 | 77 |
78 // Overridden from aura::WindowObserver: | 78 // Overridden from aura::WindowObserver: |
79 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; | 79 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; |
80 void OnWindowDestroying(aura::Window* window) override; | 80 void OnWindowDestroying(aura::Window* window) override; |
81 void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override; | 81 void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override; |
82 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; | 82 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; |
83 | 83 |
| 84 private: |
84 // Internal implementation that coordinates window focus and activation | 85 // Internal implementation that coordinates window focus and activation |
85 // changes. | 86 // changes. |
86 void FocusAndActivateWindow( | 87 void FocusAndActivateWindow( |
87 aura::client::ActivationChangeObserver::ActivationReason reason, | 88 aura::client::ActivationChangeObserver::ActivationReason reason, |
88 aura::Window* window); | 89 aura::Window* window); |
89 | 90 |
90 // Internal implementation that sets the focused window, fires events etc. | 91 // Internal implementation that sets the focused window, fires events etc. |
91 // This function must be called with a valid focusable window. | 92 // This function must be called with a valid focusable window. |
92 void SetFocusedWindow(aura::Window* window); | 93 void SetFocusedWindow(aura::Window* window); |
93 | 94 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 base::ObserverList<aura::client::FocusChangeObserver> focus_observers_; | 131 base::ObserverList<aura::client::FocusChangeObserver> focus_observers_; |
131 | 132 |
132 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 133 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
133 | 134 |
134 DISALLOW_COPY_AND_ASSIGN(FocusController); | 135 DISALLOW_COPY_AND_ASSIGN(FocusController); |
135 }; | 136 }; |
136 | 137 |
137 } // namespace wm | 138 } // namespace wm |
138 | 139 |
139 #endif // UI_WM_CORE_FOCUS_CONTROLLER_H_ | 140 #endif // UI_WM_CORE_FOCUS_CONTROLLER_H_ |
OLD | NEW |