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 #include "components/mus/ws/test_change_tracker.h" | 5 #include "components/mus/ws/test_change_tracker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 return "OnEmbed"; | 40 return "OnEmbed"; |
41 | 41 |
42 case CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED: | 42 case CHANGE_TYPE_EMBEDDED_APP_DISCONNECTED: |
43 return base::StringPrintf("OnEmbeddedAppDisconnected window=%s", | 43 return base::StringPrintf("OnEmbeddedAppDisconnected window=%s", |
44 WindowIdToString(change.window_id).c_str()); | 44 WindowIdToString(change.window_id).c_str()); |
45 | 45 |
46 case CHANGE_TYPE_UNEMBED: | 46 case CHANGE_TYPE_UNEMBED: |
47 return base::StringPrintf("OnUnembed window=%s", | 47 return base::StringPrintf("OnUnembed window=%s", |
48 WindowIdToString(change.window_id).c_str()); | 48 WindowIdToString(change.window_id).c_str()); |
49 | 49 |
| 50 case CHANGE_TYPE_LOST_CAPTURE: |
| 51 return base::StringPrintf("OnLostCapture window=%s", |
| 52 WindowIdToString(change.window_id).c_str()); |
| 53 |
50 case CHANGE_TYPE_NODE_ADD_TRANSIENT_WINDOW: | 54 case CHANGE_TYPE_NODE_ADD_TRANSIENT_WINDOW: |
51 return base::StringPrintf("AddTransientWindow parent = %s child = %s", | 55 return base::StringPrintf("AddTransientWindow parent = %s child = %s", |
52 WindowIdToString(change.window_id).c_str(), | 56 WindowIdToString(change.window_id).c_str(), |
53 WindowIdToString(change.window_id2).c_str()); | 57 WindowIdToString(change.window_id2).c_str()); |
54 | 58 |
55 case CHANGE_TYPE_NODE_BOUNDS_CHANGED: | 59 case CHANGE_TYPE_NODE_BOUNDS_CHANGED: |
56 return base::StringPrintf( | 60 return base::StringPrintf( |
57 "BoundsChanged window=%s old_bounds=%s new_bounds=%s", | 61 "BoundsChanged window=%s old_bounds=%s new_bounds=%s", |
58 WindowIdToString(change.window_id).c_str(), | 62 WindowIdToString(change.window_id).c_str(), |
59 RectToString(change.bounds).c_str(), | 63 RectToString(change.bounds).c_str(), |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 252 |
249 void TestChangeTracker::OnTransientWindowRemoved(Id window_id, | 253 void TestChangeTracker::OnTransientWindowRemoved(Id window_id, |
250 Id transient_window_id) { | 254 Id transient_window_id) { |
251 Change change; | 255 Change change; |
252 change.type = CHANGE_TYPE_NODE_REMOVE_TRANSIENT_WINDOW_FROM_PARENT; | 256 change.type = CHANGE_TYPE_NODE_REMOVE_TRANSIENT_WINDOW_FROM_PARENT; |
253 change.window_id = window_id; | 257 change.window_id = window_id; |
254 change.window_id2 = transient_window_id; | 258 change.window_id2 = transient_window_id; |
255 AddChange(change); | 259 AddChange(change); |
256 } | 260 } |
257 | 261 |
| 262 void TestChangeTracker::OnLostCapture(Id window_id) { |
| 263 Change change; |
| 264 change.type = CHANGE_TYPE_LOST_CAPTURE; |
| 265 change.window_id = window_id; |
| 266 AddChange(change); |
| 267 } |
| 268 |
258 void TestChangeTracker::OnWindowViewportMetricsChanged( | 269 void TestChangeTracker::OnWindowViewportMetricsChanged( |
259 mojom::ViewportMetricsPtr old_metrics, | 270 mojom::ViewportMetricsPtr old_metrics, |
260 mojom::ViewportMetricsPtr new_metrics) { | 271 mojom::ViewportMetricsPtr new_metrics) { |
261 Change change; | 272 Change change; |
262 change.type = CHANGE_TYPE_NODE_VIEWPORT_METRICS_CHANGED; | 273 change.type = CHANGE_TYPE_NODE_VIEWPORT_METRICS_CHANGED; |
263 // NOT IMPLEMENTED | 274 // NOT IMPLEMENTED |
264 AddChange(change); | 275 AddChange(change); |
265 } | 276 } |
266 | 277 |
267 void TestChangeTracker::OnWindowHierarchyChanged( | 278 void TestChangeTracker::OnWindowHierarchyChanged( |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 std::string TestWindow::ToString2() const { | 399 std::string TestWindow::ToString2() const { |
389 return base::StringPrintf( | 400 return base::StringPrintf( |
390 "window=%s parent=%s visible=%s drawn=%s", | 401 "window=%s parent=%s visible=%s drawn=%s", |
391 WindowIdToString(window_id).c_str(), WindowIdToString(parent_id).c_str(), | 402 WindowIdToString(window_id).c_str(), WindowIdToString(parent_id).c_str(), |
392 visible ? "true" : "false", drawn ? "true" : "false"); | 403 visible ? "true" : "false", drawn ? "true" : "false"); |
393 } | 404 } |
394 | 405 |
395 } // namespace ws | 406 } // namespace ws |
396 | 407 |
397 } // namespace mus | 408 } // namespace mus |
OLD | NEW |