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