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_WS_TEST_CHANGE_TRACKER_H_ | 5 #ifndef COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_ |
6 #define COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_ | 6 #define COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "components/mus/common/types.h" | 14 #include "components/mus/common/types.h" |
15 #include "components/mus/public/interfaces/window_tree.mojom.h" | 15 #include "components/mus/public/interfaces/window_tree.mojom.h" |
16 #include "mojo/public/cpp/bindings/array.h" | 16 #include "mojo/public/cpp/bindings/array.h" |
17 #include "ui/mojo/geometry/geometry.mojom.h" | 17 #include "ui/mojo/geometry/geometry.mojom.h" |
18 | 18 |
19 namespace mus { | 19 namespace mus { |
20 | 20 |
21 namespace ws { | 21 namespace ws { |
22 | 22 |
23 enum ChangeType { | 23 enum ChangeType { |
24 CHANGE_TYPE_EMBED, | 24 CHANGE_TYPE_EMBED, |
25 CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED, | 25 CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED, |
26 CHANGE_TYPE_UNEMBED, | 26 CHANGE_TYPE_UNEMBED, |
| 27 CHANGE_TYPE_LOST_CAPTURE, |
27 // TODO(sky): nuke NODE. | 28 // TODO(sky): nuke NODE. |
28 CHANGE_TYPE_NODE_ADD_TRANSIENT_WINDOW, | 29 CHANGE_TYPE_NODE_ADD_TRANSIENT_WINDOW, |
29 CHANGE_TYPE_NODE_BOUNDS_CHANGED, | 30 CHANGE_TYPE_NODE_BOUNDS_CHANGED, |
30 CHANGE_TYPE_NODE_VIEWPORT_METRICS_CHANGED, | 31 CHANGE_TYPE_NODE_VIEWPORT_METRICS_CHANGED, |
31 CHANGE_TYPE_NODE_HIERARCHY_CHANGED, | 32 CHANGE_TYPE_NODE_HIERARCHY_CHANGED, |
32 CHANGE_TYPE_NODE_REMOVE_TRANSIENT_WINDOW_FROM_PARENT, | 33 CHANGE_TYPE_NODE_REMOVE_TRANSIENT_WINDOW_FROM_PARENT, |
33 CHANGE_TYPE_NODE_REORDERED, | 34 CHANGE_TYPE_NODE_REORDERED, |
34 CHANGE_TYPE_NODE_VISIBILITY_CHANGED, | 35 CHANGE_TYPE_NODE_VISIBILITY_CHANGED, |
35 CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED, | 36 CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED, |
36 CHANGE_TYPE_NODE_DELETED, | 37 CHANGE_TYPE_NODE_DELETED, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 124 |
124 void set_delegate(Delegate* delegate) { delegate_ = delegate; } | 125 void set_delegate(Delegate* delegate) { delegate_ = delegate; } |
125 | 126 |
126 std::vector<Change>* changes() { return &changes_; } | 127 std::vector<Change>* changes() { return &changes_; } |
127 | 128 |
128 // Each of these functions generate a Change. There is one per | 129 // Each of these functions generate a Change. There is one per |
129 // WindowTreeClient function. | 130 // WindowTreeClient function. |
130 void OnEmbed(ConnectionSpecificId connection_id, mojom::WindowDataPtr root); | 131 void OnEmbed(ConnectionSpecificId connection_id, mojom::WindowDataPtr root); |
131 void OnEmbeddedAppDisconnected(Id window_id); | 132 void OnEmbeddedAppDisconnected(Id window_id); |
132 void OnUnembed(Id window_id); | 133 void OnUnembed(Id window_id); |
| 134 void OnLostCapture(Id window_id); |
133 void OnTransientWindowAdded(Id window_id, Id transient_window_id); | 135 void OnTransientWindowAdded(Id window_id, Id transient_window_id); |
134 void OnTransientWindowRemoved(Id window_id, Id transient_window_id); | 136 void OnTransientWindowRemoved(Id window_id, Id transient_window_id); |
135 void OnWindowBoundsChanged(Id window_id, | 137 void OnWindowBoundsChanged(Id window_id, |
136 mojo::RectPtr old_bounds, | 138 mojo::RectPtr old_bounds, |
137 mojo::RectPtr new_bounds); | 139 mojo::RectPtr new_bounds); |
138 void OnWindowViewportMetricsChanged(mojom::ViewportMetricsPtr old_bounds, | 140 void OnWindowViewportMetricsChanged(mojom::ViewportMetricsPtr old_bounds, |
139 mojom::ViewportMetricsPtr new_bounds); | 141 mojom::ViewportMetricsPtr new_bounds); |
140 void OnWindowHierarchyChanged(Id window_id, | 142 void OnWindowHierarchyChanged(Id window_id, |
141 Id new_parent_id, | 143 Id new_parent_id, |
142 Id old_parent_id, | 144 Id old_parent_id, |
(...skipping 20 matching lines...) Expand all Loading... |
163 std::vector<Change> changes_; | 165 std::vector<Change> changes_; |
164 | 166 |
165 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker); | 167 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker); |
166 }; | 168 }; |
167 | 169 |
168 } // namespace ws | 170 } // namespace ws |
169 | 171 |
170 } // namespace mus | 172 } // namespace mus |
171 | 173 |
172 #endif // COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_ | 174 #endif // COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_ |
OLD | NEW |