OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 5 #ifndef UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void RemoveObserver(WindowTreeClientObserver* observer); | 157 void RemoveObserver(WindowTreeClientObserver* observer); |
158 | 158 |
159 private: | 159 private: |
160 friend class InFlightBoundsChange; | 160 friend class InFlightBoundsChange; |
161 friend class InFlightFocusChange; | 161 friend class InFlightFocusChange; |
162 friend class InFlightPropertyChange; | 162 friend class InFlightPropertyChange; |
163 friend class InFlightVisibleChange; | 163 friend class InFlightVisibleChange; |
164 friend class WindowPortMus; | 164 friend class WindowPortMus; |
165 friend class WindowTreeClientPrivate; | 165 friend class WindowTreeClientPrivate; |
166 | 166 |
| 167 enum class Origin { |
| 168 CLIENT, |
| 169 SERVER, |
| 170 }; |
| 171 |
167 using IdToWindowMap = std::map<Id, WindowMus*>; | 172 using IdToWindowMap = std::map<Id, WindowMus*>; |
168 | 173 |
169 // TODO(sky): this assumes change_ids never wrap, which is a bad assumption. | 174 // TODO(sky): this assumes change_ids never wrap, which is a bad assumption. |
170 using InFlightMap = std::map<uint32_t, std::unique_ptr<InFlightChange>>; | 175 using InFlightMap = std::map<uint32_t, std::unique_ptr<InFlightChange>>; |
171 | 176 |
172 void RegisterWindowMus(WindowMus* window); | 177 void RegisterWindowMus(WindowMus* window); |
173 | 178 |
174 WindowMus* GetWindowByServerId(Id id); | 179 WindowMus* GetWindowByServerId(Id id); |
175 | 180 |
176 // Returns true if the specified window was created by this client. | 181 // Returns true if the specified window was created by this client. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 const gfx::Rect& revert_bounds); | 252 const gfx::Rect& revert_bounds); |
248 void SetWindowVisibleFromServer(WindowMus* window, bool visible); | 253 void SetWindowVisibleFromServer(WindowMus* window, bool visible); |
249 | 254 |
250 // Called from OnWindowMusBoundsChanged() and SetRootWindowBounds(). | 255 // Called from OnWindowMusBoundsChanged() and SetRootWindowBounds(). |
251 void ScheduleInFlightBoundsChange(WindowMus* window, | 256 void ScheduleInFlightBoundsChange(WindowMus* window, |
252 const gfx::Rect& old_bounds, | 257 const gfx::Rect& old_bounds, |
253 const gfx::Rect& new_bounds); | 258 const gfx::Rect& new_bounds); |
254 | 259 |
255 // Following are called from WindowMus. | 260 // Following are called from WindowMus. |
256 void OnWindowMusCreated(WindowMus* window); | 261 void OnWindowMusCreated(WindowMus* window); |
257 void OnWindowMusDestroyed(WindowMus* window); | 262 void OnWindowMusDestroyed(WindowMus* window, Origin origin); |
258 void OnWindowMusBoundsChanged(WindowMus* window, | 263 void OnWindowMusBoundsChanged(WindowMus* window, |
259 const gfx::Rect& old_bounds, | 264 const gfx::Rect& old_bounds, |
260 const gfx::Rect& new_bounds); | 265 const gfx::Rect& new_bounds); |
261 void OnWindowMusAddChild(WindowMus* parent, WindowMus* child); | 266 void OnWindowMusAddChild(WindowMus* parent, WindowMus* child); |
262 void OnWindowMusRemoveChild(WindowMus* parent, WindowMus* child); | 267 void OnWindowMusRemoveChild(WindowMus* parent, WindowMus* child); |
263 void OnWindowMusMoveChild(WindowMus* parent, | 268 void OnWindowMusMoveChild(WindowMus* parent, |
264 size_t current_index, | 269 size_t current_index, |
265 size_t dest_index); | 270 size_t dest_index); |
266 void OnWindowMusSetVisible(WindowMus* window, bool visible); | 271 void OnWindowMusSetVisible(WindowMus* window, bool visible); |
267 std::unique_ptr<WindowPortPropertyData> OnWindowMusWillChangeProperty( | 272 std::unique_ptr<WindowPortPropertyData> OnWindowMusWillChangeProperty( |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; | 497 std::unique_ptr<DragDropControllerMus> drag_drop_controller_; |
493 | 498 |
494 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 499 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
495 | 500 |
496 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 501 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
497 }; | 502 }; |
498 | 503 |
499 } // namespace aura | 504 } // namespace aura |
500 | 505 |
501 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 506 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
OLD | NEW |