| 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 24 matching lines...) Expand all Loading... |
| 35 CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED, | 35 CHANGE_TYPE_NODE_DRAWN_STATE_CHANGED, |
| 36 CHANGE_TYPE_NODE_DELETED, | 36 CHANGE_TYPE_NODE_DELETED, |
| 37 CHANGE_TYPE_INPUT_EVENT, | 37 CHANGE_TYPE_INPUT_EVENT, |
| 38 CHANGE_TYPE_POINTER_WATCHER_EVENT, | 38 CHANGE_TYPE_POINTER_WATCHER_EVENT, |
| 39 CHANGE_TYPE_PROPERTY_CHANGED, | 39 CHANGE_TYPE_PROPERTY_CHANGED, |
| 40 CHANGE_TYPE_FOCUSED, | 40 CHANGE_TYPE_FOCUSED, |
| 41 CHANGE_TYPE_CURSOR_CHANGED, | 41 CHANGE_TYPE_CURSOR_CHANGED, |
| 42 CHANGE_TYPE_ON_CHANGE_COMPLETED, | 42 CHANGE_TYPE_ON_CHANGE_COMPLETED, |
| 43 CHANGE_TYPE_ON_TOP_LEVEL_CREATED, | 43 CHANGE_TYPE_ON_TOP_LEVEL_CREATED, |
| 44 CHANGE_TYPE_OPACITY, | 44 CHANGE_TYPE_OPACITY, |
| 45 CHANGE_TYPE_SURFACE_CHANGED, |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 // TODO(sky): consider nuking and converting directly to WindowData. | 48 // TODO(sky): consider nuking and converting directly to WindowData. |
| 48 struct TestWindow { | 49 struct TestWindow { |
| 49 TestWindow(); | 50 TestWindow(); |
| 50 TestWindow(const TestWindow& other); | 51 TestWindow(const TestWindow& other); |
| 51 ~TestWindow(); | 52 ~TestWindow(); |
| 52 | 53 |
| 53 // Returns a string description of this. | 54 // Returns a string description of this. |
| 54 std::string ToString() const; | 55 std::string ToString() const; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 80 int32_t event_action; | 81 int32_t event_action; |
| 81 bool matches_pointer_watcher; | 82 bool matches_pointer_watcher; |
| 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; |
| 91 cc::SurfaceId surface_id; |
| 92 cc::SurfaceSequence surface_sequence; |
| 93 gfx::Size frame_size; |
| 94 float device_scale_factor; |
| 90 }; | 95 }; |
| 91 | 96 |
| 92 // Converts Changes to string descriptions. | 97 // Converts Changes to string descriptions. |
| 93 std::vector<std::string> ChangesToDescription1( | 98 std::vector<std::string> ChangesToDescription1( |
| 94 const std::vector<Change>& changes); | 99 const std::vector<Change>& changes); |
| 95 | 100 |
| 96 // Convenience for returning the description of the first item in |changes|. | 101 // Convenience for returning the description of the first item in |changes|. |
| 97 // Returns an empty string if |changes| has something other than one entry. | 102 // Returns an empty string if |changes| has something other than one entry. |
| 98 std::string SingleChangeToDescription(const std::vector<Change>& changes); | 103 std::string SingleChangeToDescription(const std::vector<Change>& changes); |
| 99 std::string SingleChangeToDescription2(const std::vector<Change>& changes); | 104 std::string SingleChangeToDescription2(const std::vector<Change>& changes); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 uint32_t window_id); | 167 uint32_t window_id); |
| 163 void OnWindowSharedPropertyChanged(Id window_id, | 168 void OnWindowSharedPropertyChanged(Id window_id, |
| 164 mojo::String name, | 169 mojo::String name, |
| 165 mojo::Array<uint8_t> data); | 170 mojo::Array<uint8_t> data); |
| 166 void OnWindowFocused(Id window_id); | 171 void OnWindowFocused(Id window_id); |
| 167 void OnWindowPredefinedCursorChanged(Id window_id, mojom::Cursor cursor_id); | 172 void OnWindowPredefinedCursorChanged(Id window_id, mojom::Cursor cursor_id); |
| 168 void OnChangeCompleted(uint32_t change_id, bool success); | 173 void OnChangeCompleted(uint32_t change_id, bool success); |
| 169 void OnTopLevelCreated(uint32_t change_id, | 174 void OnTopLevelCreated(uint32_t change_id, |
| 170 mojom::WindowDataPtr window_data, | 175 mojom::WindowDataPtr window_data, |
| 171 bool drawn); | 176 bool drawn); |
| 177 void OnWindowSurfaceChanged(Id window_id, |
| 178 const cc::SurfaceId& surface_id, |
| 179 const cc::SurfaceSequence& surface_sequence, |
| 180 const gfx::Size& frame_size, |
| 181 float device_scale_factor); |
| 172 | 182 |
| 173 private: | 183 private: |
| 174 void AddChange(const Change& change); | 184 void AddChange(const Change& change); |
| 175 | 185 |
| 176 Delegate* delegate_; | 186 Delegate* delegate_; |
| 177 std::vector<Change> changes_; | 187 std::vector<Change> changes_; |
| 178 | 188 |
| 179 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker); | 189 DISALLOW_COPY_AND_ASSIGN(TestChangeTracker); |
| 180 }; | 190 }; |
| 181 | 191 |
| 182 } // namespace ws | 192 } // namespace ws |
| 183 | 193 |
| 184 } // namespace ui | 194 } // namespace ui |
| 185 | 195 |
| 186 #endif // SERVICES_UI_WS_TEST_CHANGE_TRACKER_H_ | 196 #endif // SERVICES_UI_WS_TEST_CHANGE_TRACKER_H_ |
| OLD | NEW |