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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "base/scoped_observer.h" | 11 #include "base/scoped_observer.h" |
12 #include "ui/aura/client/focus_client.h" | 12 #include "ui/aura/client/focus_client.h" |
13 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
14 #include "ui/events/event_handler.h" | 14 #include "ui/events/event_handler.h" |
15 #include "ui/wm/core/wm_core_export.h" | |
16 #include "ui/wm/public/activation_client.h" | 15 #include "ui/wm/public/activation_client.h" |
| 16 #include "ui/wm/wm_export.h" |
17 | 17 |
18 namespace wm { | 18 namespace wm { |
19 | 19 |
20 class FocusRules; | 20 class FocusRules; |
21 | 21 |
22 // FocusController handles focus and activation changes for an environment | 22 // FocusController handles focus and activation changes for an environment |
23 // encompassing one or more RootWindows. Within an environment there can be | 23 // encompassing one or more RootWindows. Within an environment there can be |
24 // only one focused and one active window at a time. When focus or activation | 24 // only one focused and one active window at a time. When focus or activation |
25 // changes notifications are sent using the | 25 // changes notifications are sent using the |
26 // aura::client::Focus/ActivationChangeObserver interfaces. | 26 // aura::client::Focus/ActivationChangeObserver interfaces. |
27 // Changes to focus and activation can be from three sources: | 27 // Changes to focus and activation can be from three sources: |
28 // . the Aura Client API (implemented here in aura::client::ActivationClient). | 28 // . the Aura Client API (implemented here in aura::client::ActivationClient). |
29 // (The FocusController must be set as the ActivationClient implementation | 29 // (The FocusController must be set as the ActivationClient implementation |
30 // for all RootWindows). | 30 // for all RootWindows). |
31 // . input events (implemented here in ui::EventHandler). | 31 // . input events (implemented here in ui::EventHandler). |
32 // (The FocusController must be registered as a pre-target handler for | 32 // (The FocusController must be registered as a pre-target handler for |
33 // the applicable environment owner, either a RootWindow or another type). | 33 // the applicable environment owner, either a RootWindow or another type). |
34 // . Window disposition changes (implemented here in aura::WindowObserver). | 34 // . Window disposition changes (implemented here in aura::WindowObserver). |
35 // (The FocusController registers itself as an observer of the active and | 35 // (The FocusController registers itself as an observer of the active and |
36 // focused windows). | 36 // focused windows). |
37 class WM_CORE_EXPORT FocusController : public aura::client::ActivationClient, | 37 class WM_EXPORT FocusController : public aura::client::ActivationClient, |
38 public aura::client::FocusClient, | 38 public aura::client::FocusClient, |
39 public ui::EventHandler, | 39 public ui::EventHandler, |
40 public aura::WindowObserver { | 40 public aura::WindowObserver { |
41 public: | 41 public: |
42 // |rules| cannot be NULL. | 42 // |rules| cannot be NULL. |
43 explicit FocusController(FocusRules* rules); | 43 explicit FocusController(FocusRules* rules); |
44 virtual ~FocusController(); | 44 virtual ~FocusController(); |
45 | 45 |
46 private: | 46 private: |
47 // Overridden from aura::client::ActivationClient: | 47 // Overridden from aura::client::ActivationClient: |
48 virtual void AddObserver( | 48 virtual void AddObserver( |
49 aura::client::ActivationChangeObserver* observer) OVERRIDE; | 49 aura::client::ActivationChangeObserver* observer) OVERRIDE; |
50 virtual void RemoveObserver( | 50 virtual void RemoveObserver( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ObserverList<aura::client::FocusChangeObserver> focus_observers_; | 119 ObserverList<aura::client::FocusChangeObserver> focus_observers_; |
120 | 120 |
121 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 121 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(FocusController); | 123 DISALLOW_COPY_AND_ASSIGN(FocusController); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace wm | 126 } // namespace wm |
127 | 127 |
128 #endif // UI_WM_CORE_FOCUS_CONTROLLER_H_ | 128 #endif // UI_WM_CORE_FOCUS_CONTROLLER_H_ |
OLD | NEW |