Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: components/mus/ws/test_change_tracker.h

Issue 1352043005: mus: Implement Window Server Capture Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added capture unit tests Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "components/mus/common/types.h" 12 #include "components/mus/common/types.h"
13 #include "components/mus/public/interfaces/window_tree.mojom.h" 13 #include "components/mus/public/interfaces/window_tree.mojom.h"
14 #include "mojo/public/cpp/bindings/array.h" 14 #include "mojo/public/cpp/bindings/array.h"
15 #include "ui/mojo/geometry/geometry.mojom.h" 15 #include "ui/mojo/geometry/geometry.mojom.h"
16 16
17 namespace mus { 17 namespace mus {
18 18
19 namespace ws { 19 namespace ws {
20 20
21 enum ChangeType { 21 enum ChangeType {
22 CHANGE_TYPE_EMBED, 22 CHANGE_TYPE_EMBED,
23 CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED, 23 CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED,
24 CHANGE_TYPE_UNEMBED, 24 CHANGE_TYPE_UNEMBED,
25 CHANGE_TYPE_LOST_CAPTURE,
25 // TODO(sky): nuke NODE. 26 // TODO(sky): nuke NODE.
26 CHANGE_TYPE_NODE_ADD_TRANSIENT_WINDOW, 27 CHANGE_TYPE_NODE_ADD_TRANSIENT_WINDOW,
27 CHANGE_TYPE_NODE_BOUNDS_CHANGED, 28 CHANGE_TYPE_NODE_BOUNDS_CHANGED,
28 CHANGE_TYPE_NODE_VIEWPORT_METRICS_CHANGED, 29 CHANGE_TYPE_NODE_VIEWPORT_METRICS_CHANGED,
29 CHANGE_TYPE_NODE_HIERARCHY_CHANGED, 30 CHANGE_TYPE_NODE_HIERARCHY_CHANGED,
30 CHANGE_TYPE_NODE_REMOVE_TRANSIENT_WINDOW_FROM_PARENT, 31 CHANGE_TYPE_NODE_REMOVE_TRANSIENT_WINDOW_FROM_PARENT,
31 CHANGE_TYPE_NODE_REORDERED, 32 CHANGE_TYPE_NODE_REORDERED,
32 CHANGE_TYPE_NODE_VISIBILITY_CHANGED, 33 CHANGE_TYPE_NODE_VISIBILITY_CHANGED,
33 CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED, 34 CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED,
34 CHANGE_TYPE_NODE_DELETED, 35 CHANGE_TYPE_NODE_DELETED,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 118
118 void set_delegate(Delegate* delegate) { delegate_ = delegate; } 119 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
119 120
120 std::vector<Change>* changes() { return &changes_; } 121 std::vector<Change>* changes() { return &changes_; }
121 122
122 // Each of these functions generate a Change. There is one per 123 // Each of these functions generate a Change. There is one per
123 // WindowTreeClient function. 124 // WindowTreeClient function.
124 void OnEmbed(ConnectionSpecificId connection_id, mojom::WindowDataPtr root); 125 void OnEmbed(ConnectionSpecificId connection_id, mojom::WindowDataPtr root);
125 void OnEmbeddedAppDisconnected(Id window_id); 126 void OnEmbeddedAppDisconnected(Id window_id);
126 void OnUnembed(); 127 void OnUnembed();
128 void OnLostCapture(Id window_id);
127 void OnTransientWindowAdded(Id window_id, Id transient_window_id); 129 void OnTransientWindowAdded(Id window_id, Id transient_window_id);
128 void OnTransientWindowRemoved(Id window_id, Id transient_window_id); 130 void OnTransientWindowRemoved(Id window_id, Id transient_window_id);
129 void OnWindowBoundsChanged(Id window_id, 131 void OnWindowBoundsChanged(Id window_id,
130 mojo::RectPtr old_bounds, 132 mojo::RectPtr old_bounds,
131 mojo::RectPtr new_bounds); 133 mojo::RectPtr new_bounds);
132 void OnWindowViewportMetricsChanged(mojom::ViewportMetricsPtr old_bounds, 134 void OnWindowViewportMetricsChanged(mojom::ViewportMetricsPtr old_bounds,
133 mojom::ViewportMetricsPtr new_bounds); 135 mojom::ViewportMetricsPtr new_bounds);
134 void OnWindowHierarchyChanged(Id window_id, 136 void OnWindowHierarchyChanged(Id window_id,
135 Id new_parent_id, 137 Id new_parent_id,
136 Id old_parent_id, 138 Id old_parent_id,
(...skipping 18 matching lines...) Expand all
155 std::vector<Change> changes_; 157 std::vector<Change> changes_;
156 158
157 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker); 159 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker);
158 }; 160 };
159 161
160 } // namespace ws 162 } // namespace ws
161 163
162 } // namespace mus 164 } // namespace mus
163 165
164 #endif // COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_ 166 #endif // COMPONENTS_MUS_WS_TEST_CHANGE_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698