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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view.cc

Issue 658923003: Remove dependency on ui from view_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase Created 6 years, 2 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: mojo/services/public/cpp/view_manager/lib/view.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/view.cc b/mojo/services/public/cpp/view_manager/lib/view.cc
index d0c86e086efc41202ad251c5082a1b412219e6bd..d7d101307e64848d2ee8718457290e76ac61b105 100644
--- a/mojo/services/public/cpp/view_manager/lib/view.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view.cc
@@ -144,8 +144,8 @@ bool ReorderImpl(View::Children* children,
class ScopedSetBoundsNotifier {
public:
ScopedSetBoundsNotifier(View* view,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds)
+ const Rect& old_bounds,
+ const Rect& new_bounds)
: view_(view),
old_bounds_(old_bounds),
new_bounds_(new_bounds) {
@@ -161,8 +161,8 @@ class ScopedSetBoundsNotifier {
private:
View* view_;
- const gfx::Rect old_bounds_;
- const gfx::Rect new_bounds_;
+ const Rect old_bounds_;
+ const Rect new_bounds_;
DISALLOW_COPY_AND_ASSIGN(ScopedSetBoundsNotifier);
};
@@ -205,7 +205,7 @@ void View::Destroy() {
LocalDestroy();
}
-void View::SetBounds(const gfx::Rect& bounds) {
+void View::SetBounds(const Rect& bounds) {
if (!OwnsView(manager_, this))
return;
@@ -391,9 +391,12 @@ bool View::LocalReorder(View* relative, OrderDirection direction) {
return ReorderImpl(&parent_->children_, this, relative, direction);
}
-void View::LocalSetBounds(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) {
- DCHECK(old_bounds == bounds_);
+void View::LocalSetBounds(const Rect& old_bounds,
+ const Rect& new_bounds) {
+ DCHECK(old_bounds.x == bounds_.x);
+ DCHECK(old_bounds.y == bounds_.y);
+ DCHECK(old_bounds.width == bounds_.width);
+ DCHECK(old_bounds.height == bounds_.height);
ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds);
bounds_ = new_bounds;
}

Powered by Google App Engine
This is Rietveld 408576698