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 SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 6 #define SERVICES_UI_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 "services/ui/public/cpp/ui_export.h" |
12 #include "services/ui/public/cpp/window.h" | 13 #include "services/ui/public/cpp/window.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
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 UI_EXPORT WindowObserver { |
29 public: | 30 public: |
30 struct TreeChangeParams { | 31 struct UI_EXPORT 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) {} |
39 virtual void OnTreeChanged(const TreeChangeParams& params) {} | 40 virtual void OnTreeChanged(const TreeChangeParams& params) {} |
40 | 41 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // allows the close it should destroy the window as appropriate. | 102 // allows the close it should destroy the window as appropriate. |
102 virtual void OnRequestClose(Window* window) {} | 103 virtual void OnRequestClose(Window* window) {} |
103 | 104 |
104 protected: | 105 protected: |
105 virtual ~WindowObserver() {} | 106 virtual ~WindowObserver() {} |
106 }; | 107 }; |
107 | 108 |
108 } // namespace ui | 109 } // namespace ui |
109 | 110 |
110 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ | 111 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_OBSERVER_H_ |
OLD | NEW |