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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.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_manager_client_impl.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
index 8004d2978ab02dd386087f4fab87b1f5204c386e..b7397b1154fe062958165a38087236840d286a08 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
@@ -37,7 +37,7 @@ View* AddViewToViewManager(ViewManagerClientImpl* client,
private_view.set_visible(view_data->visible);
private_view.set_drawn(view_data->drawn);
client->AddView(view);
- private_view.LocalSetBounds(gfx::Rect(), view_data->bounds.To<gfx::Rect>());
+ private_view.LocalSetBounds(Rect(), *view_data->bounds);
if (parent)
ViewPrivate(parent).LocalAddChild(view);
return view;
@@ -154,10 +154,9 @@ bool ViewManagerClientImpl::OwnsView(Id id) const {
return HiWord(id) == connection_id_;
}
-void ViewManagerClientImpl::SetBounds(Id view_id, const gfx::Rect& bounds) {
+void ViewManagerClientImpl::SetBounds(Id view_id, const Rect& bounds) {
DCHECK(connected_);
- service_->SetViewBounds(view_id, Rect::From(bounds),
- ActionCompletedCallback());
+ service_->SetViewBounds(view_id, bounds.Clone(), ActionCompletedCallback());
}
void ViewManagerClientImpl::SetSurfaceId(Id view_id, SurfaceIdPtr surface_id) {
@@ -265,8 +264,7 @@ void ViewManagerClientImpl::OnViewBoundsChanged(Id view_id,
RectPtr old_bounds,
RectPtr new_bounds) {
View* view = GetViewById(view_id);
- ViewPrivate(view).LocalSetBounds(old_bounds.To<gfx::Rect>(),
- new_bounds.To<gfx::Rect>());
+ ViewPrivate(view).LocalSetBounds(*old_bounds, *new_bounds);
}
void ViewManagerClientImpl::OnViewHierarchyChanged(

Powered by Google App Engine
This is Rietveld 408576698