OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 ASH_SHELF_SHELF_WINDOW_WATCHER_H_ | 5 #ifndef ASH_SHELF_SHELF_WINDOW_WATCHER_H_ |
6 #define ASH_SHELF_SHELF_WINDOW_WATCHER_H_ | 6 #define ASH_SHELF_SHELF_WINDOW_WATCHER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "ash/shelf/scoped_observer_with_duplicated_sources.h" | 10 #include "ash/shelf/scoped_observer_with_duplicated_sources.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace client { | 22 namespace client { |
23 class ActivationClient; | 23 class ActivationClient; |
24 } | 24 } |
25 | 25 |
26 } // namespace aura | 26 } // namespace aura |
27 | 27 |
28 namespace ash { | 28 namespace ash { |
29 | 29 |
30 class ShelfModel; | 30 class ShelfModel; |
31 class ShelfItemDelegateManager; | |
32 class WmWindow; | 31 class WmWindow; |
33 | 32 |
34 // ShelfWindowWatcher creates and handles a ShelfItem for windows that have | 33 // ShelfWindowWatcher creates and handles a ShelfItem for windows that have |
35 // a ShelfItemDetails property in the default container. | 34 // a ShelfItemDetails property in the default container. |
36 class ShelfWindowWatcher : public aura::client::ActivationChangeObserver, | 35 class ShelfWindowWatcher : public aura::client::ActivationChangeObserver, |
37 public aura::WindowObserver, | 36 public aura::WindowObserver, |
38 public display::DisplayObserver { | 37 public display::DisplayObserver { |
39 public: | 38 public: |
40 ShelfWindowWatcher(ShelfModel* model, | 39 explicit ShelfWindowWatcher(ShelfModel* model); |
41 ShelfItemDelegateManager* item_delegate_manager); | |
42 ~ShelfWindowWatcher() override; | 40 ~ShelfWindowWatcher() override; |
43 | 41 |
44 private: | 42 private: |
45 class RootWindowObserver : public aura::WindowObserver { | 43 class RootWindowObserver : public aura::WindowObserver { |
46 public: | 44 public: |
47 explicit RootWindowObserver(ShelfWindowWatcher* window_watcher); | 45 explicit RootWindowObserver(ShelfWindowWatcher* window_watcher); |
48 ~RootWindowObserver() override; | 46 ~RootWindowObserver() override; |
49 | 47 |
50 private: | 48 private: |
51 // aura::WindowObserver overrides: | 49 // aura::WindowObserver overrides: |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 intptr_t old) override; | 118 intptr_t old) override; |
121 | 119 |
122 // display::DisplayObserver overrides: | 120 // display::DisplayObserver overrides: |
123 void OnDisplayAdded(const display::Display& display) override; | 121 void OnDisplayAdded(const display::Display& display) override; |
124 void OnDisplayRemoved(const display::Display& old_display) override; | 122 void OnDisplayRemoved(const display::Display& old_display) override; |
125 void OnDisplayMetricsChanged(const display::Display& display, | 123 void OnDisplayMetricsChanged(const display::Display& display, |
126 uint32_t metrics) override; | 124 uint32_t metrics) override; |
127 | 125 |
128 // Owned by Shell. | 126 // Owned by Shell. |
129 ShelfModel* model_; | 127 ShelfModel* model_; |
130 ShelfItemDelegateManager* item_delegate_manager_; | |
131 | 128 |
132 RootWindowObserver root_window_observer_; | 129 RootWindowObserver root_window_observer_; |
133 | 130 |
134 RemovedWindowObserver removed_window_observer_; | 131 RemovedWindowObserver removed_window_observer_; |
135 | 132 |
136 // Holds all observed windows. | 133 // Holds all observed windows. |
137 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; | 134 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; |
138 | 135 |
139 // Holds all observed root windows. | 136 // Holds all observed root windows. |
140 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; | 137 ScopedObserver<aura::Window, aura::WindowObserver> observed_root_windows_; |
141 | 138 |
142 // Holds removed windows that has an item from default container. | 139 // Holds removed windows that has an item from default container. |
143 ScopedObserver<aura::Window, aura::WindowObserver> observed_removed_windows_; | 140 ScopedObserver<aura::Window, aura::WindowObserver> observed_removed_windows_; |
144 | 141 |
145 // Holds all observed activation clients. | 142 // Holds all observed activation clients. |
146 ScopedObserverWithDuplicatedSources<aura::client::ActivationClient, | 143 ScopedObserverWithDuplicatedSources<aura::client::ActivationClient, |
147 aura::client::ActivationChangeObserver> | 144 aura::client::ActivationChangeObserver> |
148 observed_activation_clients_; | 145 observed_activation_clients_; |
149 | 146 |
150 DISALLOW_COPY_AND_ASSIGN(ShelfWindowWatcher); | 147 DISALLOW_COPY_AND_ASSIGN(ShelfWindowWatcher); |
151 }; | 148 }; |
152 | 149 |
153 } // namespace ash | 150 } // namespace ash |
154 | 151 |
155 #endif // ASH_SHELF_SHELF_WINDOW_WATCHER_H_ | 152 #endif // ASH_SHELF_SHELF_WINDOW_WATCHER_H_ |
OLD | NEW |