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

Unified Diff: components/mus/ws/test_change_tracker.cc

Issue 2008193002: Change mojo geometry structs from using type converters to StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: components/mus/ws/test_change_tracker.cc
diff --git a/components/mus/ws/test_change_tracker.cc b/components/mus/ws/test_change_tracker.cc
index 953d66a062fa7ed80ed941adb6c126d810054e4c..5779d65a8052155938998c28d720e841e5c164c1 100644
--- a/components/mus/ws/test_change_tracker.cc
+++ b/components/mus/ws/test_change_tracker.cc
@@ -25,11 +25,6 @@ std::string WindowIdToString(Id id) {
namespace {
-std::string RectToString(const mojo::Rect& rect) {
- return base::StringPrintf("%d,%d %dx%d", rect.x, rect.y, rect.width,
- rect.height);
-}
-
std::string DirectionToString(mojom::OrderDirection direction) {
return direction == mojom::OrderDirection::ABOVE ? "above" : "below";
}
@@ -69,8 +64,7 @@ std::string ChangeToDescription(const Change& change,
return base::StringPrintf(
"BoundsChanged window=%s old_bounds=%s new_bounds=%s",
WindowIdToString(change.window_id).c_str(),
- RectToString(change.bounds).c_str(),
- RectToString(change.bounds2).c_str());
+ change.bounds.ToString().c_str(), change.bounds2.ToString().c_str());
case CHANGE_TYPE_NODE_HIERARCHY_CHANGED:
return base::StringPrintf(
@@ -256,19 +250,13 @@ void TestChangeTracker::OnEmbeddedAppDisconnected(Id window_id) {
}
void TestChangeTracker::OnWindowBoundsChanged(Id window_id,
- mojo::RectPtr old_bounds,
- mojo::RectPtr new_bounds) {
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) {
Change change;
change.type = CHANGE_TYPE_NODE_BOUNDS_CHANGED;
change.window_id = window_id;
- change.bounds.x = old_bounds->x;
- change.bounds.y = old_bounds->y;
- change.bounds.width = old_bounds->width;
- change.bounds.height = old_bounds->height;
- change.bounds2.x = new_bounds->x;
- change.bounds2.y = new_bounds->y;
- change.bounds2.width = new_bounds->width;
- change.bounds2.height = new_bounds->height;
+ change.bounds = old_bounds;
+ change.bounds2 = new_bounds;
AddChange(change);
}

Powered by Google App Engine
This is Rietveld 408576698