| OLD | NEW |
| 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 <set> |
| 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, |
| 21 // Used for both set and release capture. | 21 // Used for both set and release capture. |
| 22 CAPTURE, | 22 CAPTURE, |
| 23 FOCUS, | 23 FOCUS, |
| 24 MODAL, | 24 MODAL, |
| 25 NEW_TOP_LEVEL, | 25 NEW_TOP_LEVEL, |
| 26 NEW_WINDOW, | 26 NEW_WINDOW, |
| 27 PROPERTY, | 27 PROPERTY, |
| 28 REMOVE_TRANSIENT, | 28 REMOVE_TRANSIENT, |
| 29 REORDER, |
| 29 VISIBLE, | 30 VISIBLE, |
| 30 | 31 |
| 31 // This covers all cases that aren't used in tests. | 32 // This covers all cases that aren't used in tests. |
| 32 OTHER, | 33 OTHER, |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 struct TransientData { | 36 struct TransientData { |
| 36 Id parent_id; | 37 Id parent_id; |
| 37 Id child_id; | 38 Id child_id; |
| 38 }; | 39 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 51 | 52 |
| 52 bool WasEventAcked(uint32_t event_id) const; | 53 bool WasEventAcked(uint32_t event_id) const; |
| 53 | 54 |
| 54 mojo::Array<uint8_t> GetLastPropertyValue(); | 55 mojo::Array<uint8_t> GetLastPropertyValue(); |
| 55 | 56 |
| 56 mojo::Map<mojo::String, mojo::Array<uint8_t>> GetLastNewWindowProperties(); | 57 mojo::Map<mojo::String, mojo::Array<uint8_t>> GetLastNewWindowProperties(); |
| 57 | 58 |
| 58 // True if at least one function has been called that takes a change id. | 59 // True if at least one function has been called that takes a change id. |
| 59 bool has_change() const { return !changes_.empty(); } | 60 bool has_change() const { return !changes_.empty(); } |
| 60 | 61 |
| 62 size_t number_of_changes() const { return changes_.size(); } |
| 63 |
| 61 // Acks all changes with a value of true. | 64 // Acks all changes with a value of true. |
| 62 void AckAllChanges(); | 65 void AckAllChanges(); |
| 63 | 66 |
| 64 // Returns false if there are no, or more than one, changes of the specified | 67 // Returns false if there are no, or more than one, changes of the specified |
| 65 // type. If there is only one of the matching type it is acked with a result | 68 // type. If there is only one of the matching type it is acked with a result |
| 66 // of |result| and true is returned. | 69 // of |result| and true is returned. |
| 67 bool AckSingleChangeOfType(WindowTreeChangeType type, bool result); | 70 bool AckSingleChangeOfType(WindowTreeChangeType type, bool result); |
| 68 | 71 |
| 69 // Same as AckSingleChangeOfType(), but doesn't fail if there is more than | 72 // Same as AckSingleChangeOfType(), but doesn't fail if there is more than |
| 70 // one change of the specified type. | 73 // one change of the specified type. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 mojo::Map<mojo::String, mojo::Array<uint8_t>> last_new_window_properties_; | 190 mojo::Map<mojo::String, mojo::Array<uint8_t>> last_new_window_properties_; |
| 188 | 191 |
| 189 TransientData transient_data_; | 192 TransientData transient_data_; |
| 190 | 193 |
| 191 DISALLOW_COPY_AND_ASSIGN(TestWindowTree); | 194 DISALLOW_COPY_AND_ASSIGN(TestWindowTree); |
| 192 }; | 195 }; |
| 193 | 196 |
| 194 } // namespace aura | 197 } // namespace aura |
| 195 | 198 |
| 196 #endif // UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_ | 199 #endif // UI_AURA_TEST_MUS_TEST_WINDOW_TREE_H_ |
| OLD | NEW |