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

Side by Side Diff: ui/aura/test/mus/test_window_tree.h

Issue 2533213006: Fixes coordinates supplied to WindowTreeHost (Closed)
Patch Set: comment Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_ 5 #ifndef UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_
6 #define UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_ 6 #define UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "services/ui/public/interfaces/window_tree.mojom.h" 13 #include "services/ui/public/interfaces/window_tree.mojom.h"
14 #include "ui/aura/mus/mus_types.h" 14 #include "ui/aura/mus/mus_types.h"
15 15
16 namespace aura { 16 namespace aura {
17 17
18 enum class WindowTreeChangeType { 18 enum class WindowTreeChangeType {
19 ADD_TRANSIENT, 19 ADD_TRANSIENT,
20 BOUNDS, 20 BOUNDS,
(...skipping 24 matching lines...) Expand all
45 public: 45 public:
46 TestWindowTree(); 46 TestWindowTree();
47 ~TestWindowTree() override; 47 ~TestWindowTree() override;
48 48
49 void set_client(ui::mojom::WindowTreeClient* client) { client_ = client; } 49 void set_client(ui::mojom::WindowTreeClient* client) { client_ = client; }
50 50
51 uint32_t window_id() const { return window_id_; } 51 uint32_t window_id() const { return window_id_; }
52 52
53 bool WasEventAcked(uint32_t event_id) const; 53 bool WasEventAcked(uint32_t event_id) const;
54 54
55 // Returns the result of the specified event. UNHANDLED if |event_id| was
56 // not acked (use WasEventAcked() to determine if the event was acked).
57 ui::mojom::EventResult GetEventResult(uint32_t event_id) const;
58
55 base::Optional<std::vector<uint8_t>> GetLastPropertyValue(); 59 base::Optional<std::vector<uint8_t>> GetLastPropertyValue();
56 60
57 base::Optional<std::unordered_map<std::string, std::vector<uint8_t>>> 61 base::Optional<std::unordered_map<std::string, std::vector<uint8_t>>>
58 GetLastNewWindowProperties(); 62 GetLastNewWindowProperties();
59 63
60 // True if at least one function has been called that takes a change id. 64 // True if at least one function has been called that takes a change id.
61 bool has_change() const { return !changes_.empty(); } 65 bool has_change() const { return !changes_.empty(); }
62 66
63 size_t number_of_changes() const { return changes_.size(); } 67 size_t number_of_changes() const { return changes_.size(); }
64 68
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 uint32_t source_window_id, 187 uint32_t source_window_id,
184 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, 188 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data,
185 uint32_t drag_operation) override; 189 uint32_t drag_operation) override;
186 void CancelDragDrop(uint32_t window_id) override; 190 void CancelDragDrop(uint32_t window_id) override;
187 void PerformWindowMove(uint32_t change_id, 191 void PerformWindowMove(uint32_t change_id,
188 uint32_t window_id, 192 uint32_t window_id,
189 ui::mojom::MoveLoopSource source, 193 ui::mojom::MoveLoopSource source,
190 const gfx::Point& cursor_location) override; 194 const gfx::Point& cursor_location) override;
191 void CancelWindowMove(uint32_t window_id) override; 195 void CancelWindowMove(uint32_t window_id) override;
192 196
193 std::set<uint32_t> acked_events_; 197 struct AckedEvent {
198 uint32_t event_id;
199 ui::mojom::EventResult result;
200 };
201 std::vector<AckedEvent> acked_events_;
194 uint32_t window_id_ = 0u; 202 uint32_t window_id_ = 0u;
195 203
196 base::Optional<std::vector<uint8_t>> last_property_value_; 204 base::Optional<std::vector<uint8_t>> last_property_value_;
197 205
198 std::vector<Change> changes_; 206 std::vector<Change> changes_;
199 207
200 ui::mojom::WindowTreeClient* client_; 208 ui::mojom::WindowTreeClient* client_;
201 209
202 base::Optional<std::unordered_map<std::string, std::vector<uint8_t>>> 210 base::Optional<std::unordered_map<std::string, std::vector<uint8_t>>>
203 last_new_window_properties_; 211 last_new_window_properties_;
204 212
205 TransientData transient_data_; 213 TransientData transient_data_;
206 214
207 gfx::Insets last_client_area_; 215 gfx::Insets last_client_area_;
208 216
209 base::Optional<gfx::Rect> last_hit_test_mask_; 217 base::Optional<gfx::Rect> last_hit_test_mask_;
210 218
211 DISALLOW_COPY_AND_ASSIGN(TestWindowTree); 219 DISALLOW_COPY_AND_ASSIGN(TestWindowTree);
212 }; 220 };
213 221
214 } // namespace aura 222 } // namespace aura
215 223
216 #endif // UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_ 224 #endif // UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698