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_WS_TEST_CHANGE_TRACKER_H_ | 5 #ifndef SERVICES_UI_WS_TEST_CHANGE_TRACKER_H_ |
6 #define SERVICES_UI_WS_TEST_CHANGE_TRACKER_H_ | 6 #define SERVICES_UI_WS_TEST_CHANGE_TRACKER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 bool visible; | 61 bool visible; |
62 std::map<std::string, std::vector<uint8_t>> properties; | 62 std::map<std::string, std::vector<uint8_t>> properties; |
63 }; | 63 }; |
64 | 64 |
65 // Tracks a call to WindowTreeClient. See the individual functions for the | 65 // Tracks a call to WindowTreeClient. See the individual functions for the |
66 // fields that are used. | 66 // fields that are used. |
67 struct Change { | 67 struct Change { |
68 Change(); | 68 Change(); |
69 Change(const Change& other); | 69 Change(const Change& other); |
70 ~Change(); | 70 ~Change(); |
| 71 Change& operator=(Change other); |
71 | 72 |
72 ChangeType type; | 73 ChangeType type; |
73 ClientSpecificId client_id; | 74 ClientSpecificId client_id; |
74 std::vector<TestWindow> windows; | 75 std::vector<TestWindow> windows; |
75 Id window_id; | 76 Id window_id; |
76 Id window_id2; | 77 Id window_id2; |
77 Id window_id3; | 78 Id window_id3; |
78 gfx::Rect bounds; | 79 gfx::Rect bounds; |
79 gfx::Rect bounds2; | 80 gfx::Rect bounds2; |
80 int32_t event_action; | 81 int32_t event_action; |
81 uint32_t event_observer_id; | 82 mojo::Array<uint32_t> event_observer_ids; |
82 mojo::String embed_url; | 83 mojo::String embed_url; |
83 mojom::OrderDirection direction; | 84 mojom::OrderDirection direction; |
84 bool bool_value; | 85 bool bool_value; |
85 float float_value; | 86 float float_value; |
86 std::string property_key; | 87 std::string property_key; |
87 std::string property_value; | 88 std::string property_value; |
88 int32_t cursor_id; | 89 int32_t cursor_id; |
89 uint32_t change_id; | 90 uint32_t change_id; |
90 }; | 91 }; |
91 | 92 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 mojo::Array<mojom::WindowDataPtr> windows); | 151 mojo::Array<mojom::WindowDataPtr> windows); |
151 void OnWindowReordered(Id window_id, | 152 void OnWindowReordered(Id window_id, |
152 Id relative_window_id, | 153 Id relative_window_id, |
153 mojom::OrderDirection direction); | 154 mojom::OrderDirection direction); |
154 void OnWindowDeleted(Id window_id); | 155 void OnWindowDeleted(Id window_id); |
155 void OnWindowVisibilityChanged(Id window_id, bool visible); | 156 void OnWindowVisibilityChanged(Id window_id, bool visible); |
156 void OnWindowOpacityChanged(Id window_id, float opacity); | 157 void OnWindowOpacityChanged(Id window_id, float opacity); |
157 void OnWindowParentDrawnStateChanged(Id window_id, bool drawn); | 158 void OnWindowParentDrawnStateChanged(Id window_id, bool drawn); |
158 void OnWindowInputEvent(Id window_id, | 159 void OnWindowInputEvent(Id window_id, |
159 const ui::Event& event, | 160 const ui::Event& event, |
160 uint32_t event_observer_id); | 161 mojo::Array<uint32_t> event_observer_id); |
161 void OnEventObserved(const ui::Event& event, uint32_t event_observer_id); | 162 void OnEventObserved(const ui::Event& event, |
| 163 mojo::Array<uint32_t> event_observer_id); |
162 void OnWindowSharedPropertyChanged(Id window_id, | 164 void OnWindowSharedPropertyChanged(Id window_id, |
163 mojo::String name, | 165 mojo::String name, |
164 mojo::Array<uint8_t> data); | 166 mojo::Array<uint8_t> data); |
165 void OnWindowFocused(Id window_id); | 167 void OnWindowFocused(Id window_id); |
166 void OnWindowPredefinedCursorChanged(Id window_id, mojom::Cursor cursor_id); | 168 void OnWindowPredefinedCursorChanged(Id window_id, mojom::Cursor cursor_id); |
167 void OnChangeCompleted(uint32_t change_id, bool success); | 169 void OnChangeCompleted(uint32_t change_id, bool success); |
168 void OnTopLevelCreated(uint32_t change_id, | 170 void OnTopLevelCreated(uint32_t change_id, |
169 mojom::WindowDataPtr window_data, | 171 mojom::WindowDataPtr window_data, |
170 bool drawn); | 172 bool drawn); |
171 | 173 |
172 private: | 174 private: |
173 void AddChange(const Change& change); | 175 void AddChange(const Change& change); |
174 | 176 |
175 Delegate* delegate_; | 177 Delegate* delegate_; |
176 std::vector<Change> changes_; | 178 std::vector<Change> changes_; |
177 | 179 |
178 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker); | 180 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker); |
179 }; | 181 }; |
180 | 182 |
181 } // namespace ws | 183 } // namespace ws |
182 | 184 |
183 } // namespace ui | 185 } // namespace ui |
184 | 186 |
185 #endif // SERVICES_UI_WS_TEST_CHANGE_TRACKER_H_ | 187 #endif // SERVICES_UI_WS_TEST_CHANGE_TRACKER_H_ |
OLD | NEW |