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 COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "components/mus/public/cpp/window.h" | 10 #include "components/mus/public/cpp/window.h" |
11 #include "components/mus/public/interfaces/input_events.mojom.h" | 11 #include "components/mus/public/interfaces/input_events.mojom.h" |
12 | 12 |
13 namespace mus { | 13 namespace mus { |
14 | 14 |
15 class Window; | 15 class Window; |
16 | 16 |
17 // A note on -ing and -ed suffixes: | 17 // A note on -ing and -ed suffixes: |
18 // | 18 // |
19 // -ing methods are called before changes are applied to the local window model. | 19 // -ing methods are called before changes are applied to the local window model. |
20 // -ed methods are called after changes are applied to the local window model. | 20 // -ed methods are called after changes are applied to the local window model. |
21 // | 21 // |
22 // If the change originated from another connection to the window manager, it's | 22 // If the change originated from another connection to the window manager, it's |
23 // possible that the change has already been applied to the service-side model | 23 // possible that the change has already been applied to the service-side model |
24 // prior to being called, so for example in the case of OnWindowDestroying(), | 24 // prior to being called, so for example in the case of OnWindowDestroying(), |
25 // it's | 25 // it's possible the window has already been destroyed on the service side. |
26 // possible the window has already been destroyed on the service side. | |
27 | 26 |
28 class WindowObserver { | 27 class WindowObserver { |
29 public: | 28 public: |
30 struct TreeChangeParams { | 29 struct TreeChangeParams { |
31 TreeChangeParams(); | 30 TreeChangeParams(); |
32 Window* target; | 31 Window* target; |
33 Window* old_parent; | 32 Window* old_parent; |
34 Window* new_parent; | 33 Window* new_parent; |
35 Window* receiver; | 34 Window* receiver; |
36 }; | 35 }; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 virtual void OnWindowDrawnChanging(Window* window) {} | 96 virtual void OnWindowDrawnChanging(Window* window) {} |
98 virtual void OnWindowDrawnChanged(Window* window) {} | 97 virtual void OnWindowDrawnChanged(Window* window) {} |
99 | 98 |
100 protected: | 99 protected: |
101 virtual ~WindowObserver() {} | 100 virtual ~WindowObserver() {} |
102 }; | 101 }; |
103 | 102 |
104 } // namespace mus | 103 } // namespace mus |
105 | 104 |
106 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 105 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
OLD | NEW |