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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "components/mus/public/cpp/mus_public_export.h" |
12 #include "components/mus/public/cpp/window.h" | 13 #include "components/mus/public/cpp/window.h" |
13 | 14 |
14 namespace mus { | 15 namespace mus { |
15 | 16 |
16 class Window; | 17 class Window; |
17 | 18 |
18 // A note on -ing and -ed suffixes: | 19 // A note on -ing and -ed suffixes: |
19 // | 20 // |
20 // -ing methods are called before changes are applied to the local window model. | 21 // -ing methods are called before changes are applied to the local window model. |
21 // -ed methods are called after changes are applied to the local window model. | 22 // -ed methods are called after changes are applied to the local window model. |
22 // | 23 // |
23 // If the change originated from another connection to the window manager, it's | 24 // If the change originated from another connection to the window manager, it's |
24 // possible that the change has already been applied to the service-side model | 25 // possible that the change has already been applied to the service-side model |
25 // prior to being called, so for example in the case of OnWindowDestroying(), | 26 // prior to being called, so for example in the case of OnWindowDestroying(), |
26 // it's possible the window has already been destroyed on the service side. | 27 // it's possible the window has already been destroyed on the service side. |
27 | 28 |
28 class WindowObserver { | 29 class MUS_PUBLIC_EXPORT WindowObserver { |
29 public: | 30 public: |
30 struct TreeChangeParams { | 31 struct TreeChangeParams { |
31 TreeChangeParams(); | 32 TreeChangeParams(); |
32 Window* target; | 33 Window* target; |
33 Window* old_parent; | 34 Window* old_parent; |
34 Window* new_parent; | 35 Window* new_parent; |
35 Window* receiver; | 36 Window* receiver; |
36 }; | 37 }; |
37 | 38 |
38 virtual void OnTreeChanging(const TreeChangeParams& params) {} | 39 virtual void OnTreeChanging(const TreeChangeParams& params) {} |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // allows the close it should destroy the window as appropriate. | 107 // allows the close it should destroy the window as appropriate. |
107 virtual void OnRequestClose(Window* window) {} | 108 virtual void OnRequestClose(Window* window) {} |
108 | 109 |
109 protected: | 110 protected: |
110 virtual ~WindowObserver() {} | 111 virtual ~WindowObserver() {} |
111 }; | 112 }; |
112 | 113 |
113 } // namespace mus | 114 } // namespace mus |
114 | 115 |
115 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 116 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
OLD | NEW |